shutdown-app-gracefully

command module
v0.0.0-...-19ef425 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

README

Shutdown APP Gracefully

运行测试

  1. 运行全部测试
$ cd shutdown-app-gracefully
$ go test -cover -count=1 ./... -timeout=10s

?       github.com/TDD-all-the-things/shutdown-app-gracefully   [no test files]
ok      github.com/TDD-all-the-things/shutdown-app-gracefully/app       0.706s  coverage: 0.0% of statements
ok      github.com/TDD-all-the-things/shutdown-app-gracefully/server    0.572s  coverage: 100.0% of statements
  1. 查看app包中生成的覆盖率文件

app包中运行在子进程中的测试用例集中只有正常退出的测试用例才会生成测试覆盖率报告.

$ cd shutdown-app-gracefully
$ go tool cover -html ./app/TestApp_Exit_Gracefully.out

运行代码

$ cd shutdown-app-gracefully
$ go build
$ ./shutdown-app-gracefully
$ ctrl+c/ctrl+c

Todo

  • 处理app中所有放出的Goroutine的panic/error

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL