Skip to content

Commit

Permalink
update section54, 55
Browse files Browse the repository at this point in the history
  • Loading branch information
gleaming9 committed Nov 13, 2024
1 parent cb1defd commit c76d883
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions _chapter14/section54/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package main

import (
"fmt"
"net/http"
"os"
)

func main() {
err := http.ListenAndServe(
":18080",
http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, %s!", r.URL.Path[1:])
}),
)
if err != nil {
fmt.Printf("failed to terminate server: %v", err)
os.Exit(1)
}
}
5 changes: 5 additions & 0 deletions _chapter14/section55/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package section55

func main() {

}
7 changes: 7 additions & 0 deletions _chapter14/section55/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package section55

import "testing"

func TestMain(m *testing.M) {
go main()
}
1 change: 0 additions & 1 deletion main.go

This file was deleted.

0 comments on commit c76d883

Please sign in to comment.