package main import ( "errors" "fmt" "io" "net/http" "regexp" ) type Provider interface { GetImageList(html string) (imageUrls []string, err error) GetHtml(url string) (html string, err error) GetNext(html string) (url string, err error) GetPrev(html string) (url string, err error) } type Bato struct{} func (b *Bato) GetImageList(html string) ([]string, error) { reg, err := regexp.Compile(` 300 { return "", errors.New("could not get html") } defer func(Body io.ReadCloser) { err := Body.Close() if err != nil { fmt.Printf("Could not close body because: %v\n", err) } }(resp.Body) all, err := io.ReadAll(resp.Body) if err != nil { return "", err } h := string(all) return h, nil } func (b *Bato) GetNext(html string) (subUrl string, err error) { reg, err := regexp.Compile(`