Generation

generate functionMon, 16 Jan 2023

connect to tcpip and send

func sendMessage(msg string) error { conn, err := net.Dial("tcp", "localhost:8080") if err != nil { return err } _, err = conn.Write([]byte(msg)) if err != nil { return err } return nil }

Questions about programming?Chat with your personal AI assistant