package sample

import (
	"context"
	"net/http"
	"sync"
	"time"
)

func Run(ctx context.Context, url string) error {
	var mu sync.Mutex

	go func() {
		for {
			time.Sleep(time.Second)
		}
	}()

	for i := 0; i < 3; i++ {
		mu.Lock()
		_, err := http.Get(url)
		if err != nil {
			mu.Unlock()
			return err
		}
		mu.Unlock()
	}

	_ = ctx
	return nil
}