protohackers/cmd/smoketest/main.go

23 lines
259 B
Go
Raw Normal View History

2022-11-07 18:23:09 +00:00
package main
2022-11-07 16:56:16 +00:00
import (
2022-11-07 18:43:37 +00:00
"io"
"log"
2022-11-07 16:56:16 +00:00
"net"
2022-11-07 19:01:00 +00:00
"protohackers/pkg/conn"
2022-11-07 16:56:16 +00:00
)
func main() {
2022-11-07 19:01:00 +00:00
err := conn.StartSimple(smoketest)
2022-11-07 16:56:16 +00:00
if err != nil {
2022-11-07 18:43:37 +00:00
log.Fatalln(err)
2022-11-07 16:56:16 +00:00
}
}
2022-11-07 19:01:00 +00:00
func smoketest(c net.Conn) {
if _, err := io.Copy(c, c); err != nil {
2022-11-07 18:43:37 +00:00
log.Fatalln(err)
2022-11-07 16:56:16 +00:00
}
}