Skip to content

Commit

Permalink
context: remove trailing period from panic messages
Browse files Browse the repository at this point in the history
  • Loading branch information
knusbaum committed Mar 18, 2020
1 parent 41768f1 commit 1b7dadd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ type CancelFunc func()
// call cancel as soon as the operations running in this Context complete.
func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
if parent == nil {
panic("cannot create context from nil parent.")
panic("cannot create context from nil parent")
}
c := newCancelCtx(parent)
propagateCancel(parent, &c)
Expand Down Expand Up @@ -429,7 +429,7 @@ func (c *cancelCtx) cancel(removeFromParent bool, err error) {
// call cancel as soon as the operations running in this Context complete.
func WithDeadline(parent Context, d time.Time) (Context, CancelFunc) {
if parent == nil {
panic("cannot create context from nil parent.")
panic("cannot create context from nil parent")
}
if cur, ok := parent.Deadline(); ok && cur.Before(d) {
// The current deadline is already sooner than the new one.
Expand Down Expand Up @@ -518,7 +518,7 @@ func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) {
// type should be a pointer or interface.
func WithValue(parent Context, key, val interface{}) Context {
if parent == nil {
panic("cannot create context from nil parent.")
panic("cannot create context from nil parent")
}
if key == nil {
panic("nil key")
Expand Down

0 comments on commit 1b7dadd

Please sign in to comment.