inconshreveable / go-update

Build self-updating Golang programs
Other
2.16k stars 239 forks source link

Bug in Example? #32

Open bitnom opened 7 years ago

bitnom commented 7 years ago

For...

func doUpdate(url string) error {
    resp, err := http.Get(url)
    if err != nil {
        return err
    }
    defer resp.Body.Close()
    err := update.Apply(resp.Body, update.Options{})
    if err != nil {
        // error handling
    }
    return err
}

I get: no new variables on left side of :=

bitnom commented 7 years ago

Had to change the second usage of err to err2

ivahaev commented 7 years ago

No need to change variable name. Just use "=" instead of ":="