Skip to content

How to catch a Fatal #1656

Answered by Antonboom
dix75 asked this question in Q&A
Discussion options

You must be logged in to vote

Usually application with nice architecture have single exit point, in package main:

func main() {
   if err := run(); err != nil {
       log.Fatal(err)
   }
}

The rest code could be easily [moved in separate package and] tested without "Fatal catching".

just that Testify isn't really otherwise designed to support it

👍

Replies: 10 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by brackendawson
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
8 participants
Converted from issue

This discussion was converted from issue #858 on October 04, 2024 23:04.