Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing ctx variable in the func main() in the "introduction to acceptance tests" chapter #744

Merged

Conversation

UponTheSky
Copy link
Contributor

@UponTheSky UponTheSky commented Mar 5, 2024

While I was reading the chapter "Introduction to acceptance tests" with actual coding, I found the following missing part:

Screenshot 2024-03-06 at 6 58 34 AM

According to example code of Graceful shutdown decorator package, I would like to suggest the same code example in the book as well:

func main() {
  var (
    ctx        = context.Background()
    httpServer = &http.Server{Addr: ":8080", Handler: http.HandlerFunc(acceptancetests.SlowHandler)}
    server     = gracefulshutdown.NewServer(httpServer)
  )
  // code omitted
}

@quii quii merged commit 5fe8f46 into quii:main Mar 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants