How to test os.exit scenarios in Go

后端 未结 5 1837
渐次进展
渐次进展 2020-12-23 12:09

Given this code

func doomed() {
  os.Exit(1)
}

How do I properly test that calling this function will result in an exit using go test

5条回答
提交回复
热议问题