protohackers/cmd/smoketest/main.go

24 lines
279 B
Go

package main
import (
"io"
"log"
"net"
"protohackers/pkg/conn"
)
func main() {
err := conn.StartSimpleTCP(smoketest)
if err != nil {
log.Fatalln(err)
}
}
func smoketest(c net.Conn) {
defer c.Close()
if _, err := io.Copy(c, c); err != nil {
log.Fatalln(err)
}
}