Testing simple web server
Testing web server 101
Testing web server in Golang
Testing
req, err := http.NewRequest(
http.MethodGet, // defining method of HTTP request
"http://localhost:8080/", // Url to hit
nil, // Body (taking nil right now)
)
// checking for any errors
if err != nil {
t.Fatalf("Could not create a request %v", err)
}To record the response from the writer
To verify
Full code server.go
Full code main_test.go
Last updated