You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tomb.go
    path of file: ./repos/podman/vendor/gopkg.in/tomb.v1
    
    the code of the file until where you have to start completion: // Copyright (c) 2011 - Gustavo Niemeyer <gustavo@niemeyer
    
func (t *Tomb) Kill(reason error) {
	t.init()
	t.m.Lock()
	defer t.m.Unlock()
	if reason == ErrDying {
		if t.reason == ErrStillAlive {
			panic("tomb: Kill with ErrDying while still alive")
		}
		return
	}
	if t.reason == nil || t.reason == ErrStillAlive {
		t.reason = reason
	}
	// If the receive on t.dying succeeds, then
	// it can only be because we have already closed it.
	// If it blocks, then we know that it needs to be closed.
	select {
	case <-t.dying:
	default:
		close(t.dying)
	}
}