Popularity
5.1
Declining
Activity
0.0
Declining
189
4
19
Programming language: Go
License: MIT License
Tags:
Utilities
Latest version: v3.0.2
Death alternatives and similar packages
Based on the "Utilities" category.
Alternatively, view Death alternatives based on common mentions on social networks and blogs.
-
项目文档
基于vite+vue3+gin搭建的开发基础平台(支持TS,JS混用),集成jwt鉴权,权限管理,动态路由,显隐可控组件,分页封装,多点登录拦截,资源权限,上传下载,代码生成器,表单生成器,chatGPT自动查表等开发必备功能。 -
excelize
Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets -
godotenv
A Go port of Ruby's dotenv library (Loads environment variables from .env files) -
xlsx
(No longer maintained!) Go (golang) library for reading and writing XLSX files. -
hystrix-go
Netflix's Hystrix latency and fault tolerance library, for Go -
go-funk
A modern Go utility library which provides helpers (map, find, contains, filter, ...) -
Kopia
Cross-platform backup tool for Windows, macOS & Linux with fast, incremental backups, client-side end-to-end encryption, compression and data deduplication. CLI and GUI included. -
gorequest
GoRequest -- Simplified HTTP client ( inspired by nodejs SuperAgent ) -
goreporter
A Golang tool that does static analysis, unit testing, code review and generate code quality report. -
lancet
A comprehensive, efficient, and reusable util function library of go. -
gojson
Automatically generate Go (golang) struct definitions from example JSON -
create-go-app
✨ Create a new production-ready project with backend, frontend and deploy automation by running one CLI command! -
spinner
Go (golang) package with 90 configurable terminal spinner/progress indicators. -
EaseProbe
A simple, standalone, and lightweight tool that can do health/status checking, written in Go. -
filetype
Fast, dependency-free Go package to infer binary file types based on the magic numbers header signature -
mole
CLI application to create ssh tunnels focused on resiliency and user experience. -
boilr
:zap: boilerplate template manager that generates files or directories from template repositories -
beaver
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps. -
mimetype
A fast Golang library for media type and file extension detection, based on magic numbers -
go-underscore
Helpfully Functional Go - A useful collection of Go utilities. Designed for programmer happiness. -
JobRunner
Framework for performing work asynchronously, outside of the request flow -
git-time-metric
Simple, seamless, lightweight time tracking for Git
Clean code begins in your IDE with SonarLint
Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.
Promo
www.sonarlint.org
Do you think we are missing an alternative of Death or a related project?
Popular Comparisons
README
Death

Simple library to make it easier to manage the death of your application.
Get The Library
Use gopkg.in to import death based on your logger.
Version | Go Get URL | source | doc | Notes |
---|---|---|---|---|
3.x | gopkg.in/vrecan/death.v3 | source | doc | 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. |
2.x | gopkg.in/vrecan/death.v2 | source | doc | This supports loggers who do not return an error from their Error and Warn functions like logrus |
1.x | gopkg.in/vrecan/death.v1 | souce | doc | This supports loggers who do return an error from their Error and Warn functions like seelog |
Example
go get gopkg.in/vrecan/death.v3
Use The Library
package main
import (
DEATH "github.com/vrecan/death"
SYS "syscall"
)
func main() {
death := DEATH.NewDeath(SYS.SIGINT, SYS.SIGTERM) //pass the signals you want to end your application
//when you want to block for shutdown signals
death.WaitForDeath() // this will finish when a signal of your type is sent to your application
}
Close Other Objects On Shutdown
One simple feature of death is that it can also close other objects when shutdown starts
package main
import (
"log"
DEATH "github.com/vrecan/death"
SYS "syscall"
"io"
)
func main() {
death := DEATH.NewDeath(SYS.SIGINT, SYS.SIGTERM) //pass the signals you want to end your application
objects := make([]io.Closer, 0)
objects = append(objects, &NewType{}) // this will work as long as the type implements a Close method
//when you want to block for shutdown signals
err := death.WaitForDeath(objects...) // this will finish when a signal of your type is sent to your application
if err != nil {
log.Println(err)
os.Exit(1)
}
}
type NewType struct {
}
func (c *NewType) Close() error {
return nil
}
Or close using an anonymous function
package main
import (
DEATH "github.com/vrecan/death"
SYS "syscall"
)
func main() {
death := DEATH.NewDeath(SYS.SIGINT, SYS.SIGTERM) //pass the signals you want to end your application
//when you want to block for shutdown signals
death.WaitForDeathWithFunc(func(){
//do whatever you want on death
})
}
Release Process
Rules for release branches:
- If you are releasing a new major version you need to branch off of master into a branch
release-branch.v#
(examplerelease-branch.v2
for a 2.x release) - If you are releasing a minor or patch update to an existing major release make sure to merge master into the release branch
Rules for tagging and publishing the release
When you are ready to publish the release make sure you...
- Merge your changes into the correct release branch.
- Check out the release branch locally (example:
git pull origin release-branch.v3
) - Create a new tag for the specific release version you will publish (example:
git tag v3.0.1
) - Push the tag up to github (example:
git push origin v3.0.1
) - Go to the release tab in github
- Select the target branch as the release branch and type in the tag name (tagname should include
v
so example:v3.0.1
) - Write a title and a well worded description on exactly what is in this change
- Click publish release