Created
December 3, 2015 01:22
-
-
Save zealws/2c292ad0ee2f9fb5fca1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go run test.go google.com | |
173.194.33.163 | |
$ go run test.go 127.0.0.1 | |
127.0.0.1 | |
$ go run test.go netflix.com | |
174.129.2.58 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"gopkg.in/alecthomas/kingpin.v2" | |
) | |
func main() { | |
addr := kingpin.Arg("addr", "server address").Required().NetAddr() | |
kingpin.Parse() | |
fmt.Println(*addr) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment