package main import ( "bufio" "fmt" "log" "net" ) type MUDHandler struct { } func main() { l, err := net.Listen("tcp", ":5555") if err != nil { log.Fatal(err) } defer l.Close() for { conn, err := l.Accept() if err != nil { log.Fatal(err) } go func(c net.Conn) { s := bufio.NewScanner(c) defer c.Close() for s.Scan() { fmt.Printf("Received user input: %q\n", s.Text()) } }(conn) } }