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

doc: add warning about not copying Tomb after first use #23

Open
wants to merge 1 commit into
base: v2
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
6 changes: 3 additions & 3 deletions tomb.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// The zero value of a Tomb is ready to handle the creation of a tracked
// goroutine via its Go method, and then any tracked goroutine may call
// the Go method again to create additional tracked goroutines at
// any point.
// any point. A Tomb must not be copied after first use.
//
// If any of the tracked goroutines returns a non-nil error, or the
// Kill or Killf method is called by any goroutine in the system (tracked
Expand Down Expand Up @@ -68,7 +68,7 @@ import (
"sync"
)

// A Tomb tracks the lifecycle of one or more goroutines as alive,
// A Tomb tracks the life cycle of one or more goroutines as alive,
// dying or dead, and the reason for their death.
//
// See the package documentation for details.
Expand Down Expand Up @@ -175,7 +175,7 @@ func (t *Tomb) run(f func() error) {
// Kill puts the tomb in a dying state for the given reason,
// closes the Dying channel, and sets Alive to false.
//
// Althoguh Kill may be called multiple times, only the first
// Although Kill may be called multiple times, only the first
// non-nil error is recorded as the death reason.
//
// If reason is ErrDying, the previous reason isn't replaced
Expand Down