What is the purpose of the http.HandleFunc function in Go's HTTP server package?

  • Registering a handler function for a specific route
  • Creating a new HTTP server
  • Parsing HTTP requests
  • Sending HTTP responses
The correct option is registering a handler function for a specific route. http.HandleFunc is used to associate a handler function with a specific URL pattern. When a request matches the specified pattern, the associated handler function is called to handle the request.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *