The WithTimeout method is not a standard Go function; you likely need to use context.WithTimeout to enforce a deadline on an operation. Create a context with a timeout and pass it to your function or use it to cancel a goroutine.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
// Use ctx in your operation, e.g., http.Get(ctx, url)