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: time.go
    path of file: ./repos/stash/pkg/utils
    
    the code of the file until where you have to start completion: package utils

import "time"

// Timeout executes the provided todo function, and waits for it to return. If
// the function does not return before the wa
    
func Timeout(todo func(), waitTime time.Duration, onTimeout func(done chan struct{})) {
	done := make(chan struct{})

	go func() {
		todo()
		close(done)
	}()

	select {
	case <-done: // on time, just exit
	case <-time.After(waitTime):
		onTimeout(done)
	}
}