Davincible / goinsta

Unofficial Instagram API written in Golang (v2022)
MIT License
183 stars 56 forks source link

Fix bug null pointer doRequest #2

Closed BruAPAHE closed 3 years ago

BruAPAHE commented 3 years ago

Hello. Please fix bug on https://github.com/Davincible/goinsta/blob/master/request.go#L209 If err !=nil when request struct is nil.

`

    resp, err := insta.c.Do(req)
if err != nil {
    return nil, nil, err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
    return nil, nil, fmt.Errorf(
        "Status: '%s', Status Code: '%d', Err: '%v'",
        resp.Status,
        resp.StatusCode,
        err,
    )
}

`

Davincible commented 3 years ago

Fixed. When did you encounter this error though? What did you call?

BruAPAHE commented 3 years ago

@Davincible

        insta := goinsta.New("login", "pass")
    if err := insta.SetProxy("//ip:port", false, false); err != nil {
        log.Fatalln(err)
    }
    if err := insta.Login(); err !=nil{
        log.Fatalln(err)
    }