Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Update typos in README.md #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Signal subscriber that allows you to attach a callback to an `os.Signal` notific

Useful to react to any os.Signal.

It returns an `unsubscribe` function that can gracefully stop some http server and clean allocated object
It returns an `unsubscribe` function that can gracefully stop some http server and clean allocated objects

> :warning: If you defer unsubcribe dont forget the final `()`, If you forget it go defer will execute the subscribe process
> :warning: If you defer unsubcribe func, dont forget the final `()`, If you forget it go defer will execute the subscribe process

> defer signal.Subscribe(func(){}, signals...)**()**

Expand All @@ -39,7 +39,7 @@ import (

func main() {
defer signal.Subscribe(func(signal os.Signal) {
fmt.Println("this code is execute when signal os.Interrupt, syscall.SIGTERM was received")
fmt.Println("this code is executed when signal os.Interrupt, syscall.SIGTERM was received")
}, os.Interrupt, syscall.SIGTERM)()

// your application code here
Expand All @@ -49,7 +49,7 @@ func main() {
## With killer

The killer subscriber will register your signal handler,
but it register another one that gonna to kill (`os.Exit`) application if 2 [killer signals](killer_subscriber.go#L9) was received.
but it registers another one that gonna kill (`os.Exit`) application if 2 [killer signals](killer_subscriber.go#L9) were received.

```go
package main
Expand All @@ -66,7 +66,7 @@ import (
func main() {
defer signal.SubscribeWithKiller(func(signal os.Signal) {
// here you can implement your application stopping steps
fmt.Println("this code is execute when signal os.Interrupt, syscall.SIGTERM was received")
fmt.Println("this code is executed when signal os.Interrupt, syscall.SIGTERM was received")
}, os.Interrupt, syscall.SIGTERM)()

// your application code here
Expand Down