diff --git a/internal/experiment/openvpn/richerinput.go b/internal/experiment/openvpn/richerinput.go index e84d5c41c..5cf212770 100644 --- a/internal/experiment/openvpn/richerinput.go +++ b/internal/experiment/openvpn/richerinput.go @@ -2,7 +2,6 @@ package openvpn import ( "context" - "time" "github.com/ooni/probe-cli/v3/internal/experimentconfig" "github.com/ooni/probe-cli/v3/internal/model" @@ -102,13 +101,6 @@ func (tl *targetLoader) Load(ctx context.Context) ([]model.ExperimentTarget, err return tl.loadFromDefaultEndpoints() } -// TODO: move to targets. -func lookupHost(ctx context.Context, hostname string, r model.Resolver) ([]string, error) { - ctx, cancel := context.WithTimeout(ctx, 10*time.Second) - defer cancel() - return r.LookupHost(ctx, hostname) -} - func (tl *targetLoader) loadFromDefaultEndpoints() ([]model.ExperimentTarget, error) { targets := []model.ExperimentTarget{} diff --git a/internal/experiment/openvpn/targets.go b/internal/experiment/openvpn/targets.go index 873a286ab..99fdb7dd5 100644 --- a/internal/experiment/openvpn/targets.go +++ b/internal/experiment/openvpn/targets.go @@ -5,6 +5,7 @@ import ( "fmt" "math/rand" "slices" + "time" "github.com/ooni/probe-cli/v3/internal/legacy/netx" "github.com/ooni/probe-cli/v3/internal/model" @@ -98,6 +99,12 @@ func resolveOONIAddresses(logger model.Logger) ([]string, error) { return valid, nil } +func lookupHost(ctx context.Context, hostname string, r model.Resolver) ([]string, error) { + ctx, cancel := context.WithTimeout(ctx, 10*time.Second) + defer cancel() + return r.LookupHost(ctx, hostname) +} + // pickOONIOpenVPNTargets crafts targets from the passed array of IP addresses. func pickOONIOpenVPNTargets(ipaddrList []string) ([]string, error) {