package main import ( "fmt" "net" "os" ) func main() { command := "" // connect to this socket conn, _ := net.Dial("tcp", "127.0.0.1:8081") for _, s := range os.Args[1:] { command += s + " " } // send to socket fmt.Fprintf(conn, command+"\n") }