mirror of
https://github.com/cupcakearmy/codecrafters-http-server-go.git
synced 2025-09-01 07:20:43 +00:00
uncomment
This commit is contained in:
@@ -3,8 +3,8 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
// Uncomment this block to pass the first stage
|
||||
// "net"
|
||||
// "os"
|
||||
"net"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -13,15 +13,15 @@ func main() {
|
||||
|
||||
// Uncomment this block to pass the first stage
|
||||
//
|
||||
// l, err := net.Listen("tcp", "0.0.0.0:4221")
|
||||
// if err != nil {
|
||||
// fmt.Println("Failed to bind to port 4221")
|
||||
// os.Exit(1)
|
||||
// }
|
||||
//
|
||||
// _, err = l.Accept()
|
||||
// if err != nil {
|
||||
// fmt.Println("Error accepting connection: ", err.Error())
|
||||
// os.Exit(1)
|
||||
// }
|
||||
l, err := net.Listen("tcp", "0.0.0.0:4221")
|
||||
if err != nil {
|
||||
fmt.Println("Failed to bind to port 4221")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
_, err = l.Accept()
|
||||
if err != nil {
|
||||
fmt.Println("Error accepting connection: ", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user