Which function is commonly used in Go to handle errors by logging them and exiting the program?

  • errors.New
  • fmt.Println
  • log.Fatal
  • panic
In Go, the function commonly used to handle errors by logging them and exiting the program is 'log.Fatal'. This function logs the error message and terminates the program.
Add your answer
Loading...

Leave a comment

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