You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-13
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,23 @@
1
-
# Death [](https://travis-ci.org/vrecan/death)[](https://coveralls.io/github/vrecan/death?branch=master)
1
+
# Death [](https://travis-ci.org/vrecan/death)[](https://coveralls.io/github/vrecan/death?branch=master)[](https://pkg.go.dev/github.com/vrecan/death)[](https://gitter.im/vrecan/death?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2
2
3
-
[](https://gitter.im/vrecan/death?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
3
<p>Simple library to make it easier to manage the death of your application.</p>
5
4
6
5
## Get The Library
7
6
8
7
Use gopkg.in to import death based on your logger.
9
8
10
-
Version | Go Get URL | source | doc | Notes |
11
-
--------|------------|--------|-----|-------|
12
-
3.x | [gopkg.in/vrecan/death.v3](https://gopkg.in/vrecan/death.v3)| [source](https://github.com/vrecan/death/tree/v3.0) | [doc](https://godoc.org/gopkg.in/vrecan/death.v3) | This removes the need for an independent logger. By default death will not log but will return an error if all the closers do not properly close. If you want to provide a logger just satisfy the deathlog.Logger interface.
13
-
2.x | [gopkg.in/vrecan/death.v2](https://gopkg.in/vrecan/death.v2)| [source](https://github.com/vrecan/death/tree/v2.0) | [doc](https://godoc.org/gopkg.in/vrecan/death.v2) | This supports loggers who _do not_ return an error from their `Error` and `Warn` functions like [logrus](https://github.com/sirupsen/logrus)
14
-
1.x | [gopkg.in/vrecan/death.v1](https://gopkg.in/vrecan/death.v1)| [souce](https://github.com/vrecan/death/tree/v1.0) | [doc](https://godoc.org/gopkg.in/vrecan/death.v1) | This supports loggers who _do_ return an error from their `Error` and `Warn` functions like [seelog](https://github.com/cihub/seelog)
| 3.x |[gopkg.in/vrecan/death.v3](https://gopkg.in/vrecan/death.v3)|[source](https://github.com/vrecan/death/tree/v3.0)|[doc](https://godoc.org/gopkg.in/vrecan/death.v3)| This removes the need for an independent logger. By default death will not log but will return an error if all the closers do not properly close. If you want to provide a logger just satisfy the deathlog.Logger interface. |
12
+
| 2.x |[gopkg.in/vrecan/death.v2](https://gopkg.in/vrecan/death.v2)|[source](https://github.com/vrecan/death/tree/v2.0)|[doc](https://godoc.org/gopkg.in/vrecan/death.v2)| This supports loggers who _do not_ return an error from their `Error` and `Warn` functions like [logrus](https://github.com/sirupsen/logrus)|
13
+
| 1.x |[gopkg.in/vrecan/death.v1](https://gopkg.in/vrecan/death.v1)|[souce](https://github.com/vrecan/death/tree/v1.0)|[doc](https://godoc.org/gopkg.in/vrecan/death.v1)| This supports loggers who _do_ return an error from their `Error` and `Warn` functions like [seelog](https://github.com/cihub/seelog)|
17
14
18
15
Example
16
+
19
17
```bash
20
18
go get gopkg.in/vrecan/death.v3
21
19
```
20
+
22
21
## Use The Library
23
22
24
23
```go
@@ -37,6 +36,7 @@ func main() {
37
36
```
38
37
39
38
### Close Other Objects On Shutdown
39
+
40
40
<p>One simple feature of death is that it can also close other objects when shutdown starts</p>
41
41
42
42
```go
@@ -85,26 +85,28 @@ import (
85
85
funcmain() {
86
86
death:= DEATH.NewDeath(SYS.SIGINT, SYS.SIGTERM) //pass the signals you want to end your application
87
87
//when you want to block for shutdown signals
88
-
death.WaitForDeathWithFunc(func(){
88
+
death.WaitForDeathWithFunc(func(){
89
89
//do whatever you want on death
90
-
})
90
+
})
91
91
}
92
92
```
93
93
94
94
# Release Process
95
95
96
96
## Rules for release branches:
97
+
97
98
- If you are releasing a new major version you need to branch off of master into a branch `release-branch.v#` (example `release-branch.v2` for a 2.x release)
98
99
- If you are releasing a minor or patch update to an existing major release make sure to merge master into the release branch
99
100
100
-
101
101
## Rules for tagging and publishing the release
102
+
102
103
When you are ready to publish the release make sure you...
104
+
103
105
1. Merge your changes into the correct release branch.
104
106
2. Check out the release branch locally (example: `git pull origin release-branch.v3`)
105
107
3. Create a new tag for the specific release version you will publish (example: `git tag v3.0.1`)
106
108
4. Push the tag up to github (example: `git push origin v3.0.1`)
107
109
5. Go to the release tab in github
108
-
6. Select the target branch as the release branch and type in the tag name (tagname should include `v` so example: `v3.0.1`)
110
+
6. Select the target branch as the release branch and type in the tag name (tagname should include `v` so example: `v3.0.1`)
109
111
7. Write a title and a well worded description on exactly what is in this change
0 commit comments