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: resize.go
    path of file: ./repos/moby/daemon
    
    the code of the file until where you have to start completion: package daemon // import "github.com/docker/docker/daemon"

import (
	"context"
	"errors"
	"strconv"
	"time"

	"github.com/docker/docker/api/types/events"

    
func (daemon *Daemon) ContainerExecResize(name string, height, width int) error {
	ec, err := daemon.getExecConfig(name)
	if err != nil {
		return err
	}

	// TODO: the timeout is hardcoded here, it would be more flexible to make it
	// a parameter in resize request context, which would need API changes.
	timeout := time.NewTimer(10 * time.Second)
	defer timeout.Stop()

	select {
	case <-ec.Started:
		// An error may have occurred, so ec.Process may be nil.
		if ec.Process == nil {
			return errdefs.InvalidParameter(errors.New("exec process is not started"))
		}
		return ec.Process.Resize(context.Background(), uint32(width), uint32(height))
	case <-timeout.C:
		return errors.New("timeout waiting for exec session ready")
	}
}