func NewUpdater(year int, opts ...Option) (*Updater, error) {
	uri := allDB
	if year != -1 {
		uri = fmt.Sprintf(baseURL, year)
	}
	u := Updater{
		year: year,
	}
	var err error
	u.Fetcher.URL, err = url.Parse(uri)
	if err != nil {
		return nil, err
	}
	u.Fetcher.Compression = ovalutil.CompressionBzip2
	for _, o := range opts {
		if err := o(&u); err != nil {
			return nil, err
		}
	}
	if u.Fetcher.Client == nil {
		u.Fetcher.Client = http.DefaultClient
	}

	return &u, nil
}
// NewUpdater returns an updater configured according to the provided Options.
//
// If year is -1, the "all" database will be pulled.
NewUpdater returns an updater configured according to the provided Options.

If year is -1, the "all" database will be pulled.
// NewUpdater returns an updater configured according to the provided Options . // // If year is - 1 the " all " database will be pulled .
func NewUpdater(year int, opts ...Option) (*Updater, error) {
	uri := allDB
	if year != -1 {
		uri = fmt.Sprintf(baseURL, year)
	}
	u := Updater{
		year: year,
	}
	var err error
	u.Fetcher.URL, err = url.Parse(uri)
	if err != nil {
		return nil, err
	}
	u.Fetcher.Compression = ovalutil.CompressionBzip2
	for _, o := range opts {
		if err := o(&u); err != nil {
			return nil, err
		}
	}
	if u.Fetcher.Client == nil {
		u.Fetcher.Client = http.DefaultClient
	}
	return &u, nil
}
func NewUpdater ( year int , opts ... Option ) ( * Updater , error ) { uri := allDB if year != - 1 { uri = fmt . Sprintf ( baseURL , year ) } u := Updater { year : year , } var err error u . Fetcher . URL , err = url . Parse ( uri ) if err != nil { return nil , err } u . Fetcher . Compression = ovalutil . CompressionBzip2 for _ , o := range opts { if err := o ( & u ) ; err != nil { return nil , err } } if u . Fetcher . Client == nil { u . Fetcher . Client = http . DefaultClient } return & u , nil }
NewUpdater returns an updater configured according to the provided Options.
NewUpdater returns an updater configured according to the provided Options .