func Must(task *Task, err error) *Task {
	runtimex.PanicOnError(err, "NewTask failed")
	return task
}
Must ensures that NewTask is successful.
package geolocate
import (
	"context"
	"errors"
	"fmt"
	"net/http"
	"github.com/ooni/probe-engine/internal/runtimex"
	"github.com/ooni/probe-engine/model"
	"github.com/ooni/probe-engine/version"
)
const (
	DefaultProbeASN uint = 0
	DefaultProbeCC = "ZZ"
	DefaultProbeIP = model.DefaultProbeIP
	DefaultProbeNetworkName = ""
	DefaultResolverASN uint = 0
	DefaultResolverIP = "127.0.0.2"
	DefaultResolverNetworkName = ""
)
var (
	DefaultProbeASNString = fmt.Sprintf("AS%d", DefaultProbeASN)
	DefaultResolverASNString = fmt.Sprintf("AS%d", DefaultResolverASN)
)
var (
	ErrMissingResourcesManager = errors.New("geolocate: ResourcesManager is nil")
)
type Logger interface {
	Debugf(format string, v ...interface{})
}
type Results struct {
	ASN uint
	CountryCode string
	DidResolverLookup bool
	NetworkName string
	ProbeIP string
	ResolverASN uint
	ResolverIP string
	ResolverNetworkName string
}
func (r *Results) ASNString() string {
	return fmt.Sprintf("AS%d", r.ASN)
}
type probeIPLookupper interface {
	LookupProbeIP(ctx context.Context) (addr string, err error)
}
type asnLookupper interface {
	LookupASN(path string, ip string) (asn uint, network string, err error)
}
type countryLookupper interface {
	LookupCC(path string, ip string) (cc string, err error)
}
type resolverIPLookupper interface {
	LookupResolverIP(ctx context.Context) (addr string, err error)
}
type ResourcesManager interface {
	ASNDatabasePath() string
	CountryDatabasePath() string
	MaybeUpdateResources(ctx context.Context) error
}
type Config struct {
	EnableResolverLookup bool
	HTTPClient *http.Client
	Logger Logger
	ResourcesManager ResourcesManager
	UserAgent string
}