mirror of
https://github.com/cupcakearmy/codecrafters-http-server-go.git
synced 2024-12-21 23:56:30 +00:00
uncomment
This commit is contained in:
parent
c96ead9f16
commit
36ab88d947
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user