Golang net.DialTCP() function example
package net
Golang net.DialTCP() function usage example
target := "127.1.0.1:8080"
raddr,e := net.ResolveTCPAddr("tcp",target)
if err != nil {
fmt.Println(err)
return 1
}
conn, err := net.DialTCP("tcp",nil,raddr)
if err != nil {
fmt.Println(err)
return 1
}
localAddr := conn.LocalAddr()
fmt.Println(localAddr)
References :
Advertisement
Something interesting
Tutorials
+5.4k Golang : Intercept, inject and replay HTTP traffics from web server
+35.3k Golang : Strip slashes from string example
+6.9k Golang : Normalize email to prevent multiple signups example
+6.9k Nginx : Password protect a directory/folder
+22.8k Golang : untar or extract tar ball archive example
+6.1k Golang : Dealing with backquote
+7.3k Golang : File system scanning
+6.3k Golang : How to get capacity of a slice or array?
+7.7k Golang : Generate human readable password
+8.5k Android Studio : Import third-party library or package into Gradle Scripts
+6.3k Golang : Selection sort example
+9.5k Mac OSX : Get a process/daemon status information