package cmd import ( "fmt" "log" "net" ) var ( port string = "1302" ) type Updater interface { UpdateUser() } type User struct { Username string IP string } func (u User) UpdateUser(usr string, ip string) User { newU := new(User) newU.Username = usr newU.IP = ip return *newU } func Server() { ln, err := net.Listen("tcp", ":"+port) checkErr(err) fmt.Printf("Listening on port %v...\n", port) for { conn, err := ln.Accept() checkErr(err) go handleConn(conn) } } func getUserInput() { } func handleConn(conn net.Conn) { fmt.Println("Received connection") fmt.Fprintln(conn, "Hello buddy!") } func checkErr(err error) { if err != nil { log.Fatalf("Error: %v\n", err) } }