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: exit.go
    path of file: ./repos/testcontainers-go/wait
    
    the code of the file until where you have to start completion: package wait

import (
	"context"
	"strings"
	"time"
)

// Implement interface
var (
	_ Strategy        = (*ExitStrategy)(nil)
	_ StrategyTimeout = (*ExitStrategy)(nil)
)

// ExitStrategy will wait until container exit
type ExitStrategy struct {
	// all Strategies should have a timeout to avoid waiting infinitely
	timeout *time.Duration

	// additional properties
	PollInterval time.Duration
}

// NewExitStrategy constructs with polling interval of 100 milliseconds without timeout by default
func NewExitStrategy(
    
func (ws *ExitStrategy) WaitUntilReady(ctx context.Context, target StrategyTarget) error {
	if ws.timeout != nil {
		var cancel context.CancelFunc
		ctx, cancel = context.WithTimeout(ctx, *ws.timeout)
		defer cancel()
	}

	for {
		select {
		case <-ctx.Done():
			return ctx.Err()
		default:
			state, err := target.State(ctx)
			if err != nil {
				if !strings.Contains(err.Error(), "No such container") {
					return err
				} else {
					return nil
				}
			}
			if state.Running {
				time.Sleep(ws.PollInterval)
				continue
			}
			return nil
		}
	}
}