Skip to content

Commit 5ae57a4

Browse files
committed
Inlined Updater.fetchInfo method
1 parent 0aafda1 commit 5ae57a4

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

updater/updater_default.go

+2-10
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,6 @@ func (u *Updater) fetchBin() ([]byte, error) {
238238
return buf.Bytes(), nil
239239
}
240240

241-
func (u *Updater) fetchInfo() error {
242-
info, err := fetchInfo(u.APIURL, u.CmdName)
243-
if err != nil {
244-
return err
245-
}
246-
u.Info = info
247-
return nil
248-
}
249-
250241
func (u *Updater) getExecRelativeDir(dir string) string {
251242
filename, _ := os.Executable()
252243
path := filepath.Join(filepath.Dir(filename), dir)
@@ -267,11 +258,12 @@ func (u *Updater) update() error {
267258
}
268259
defer old.Close()
269260

270-
err = u.fetchInfo()
261+
info, err := fetchInfo(u.APIURL, u.CmdName)
271262
if err != nil {
272263
log.Println(err)
273264
return err
274265
}
266+
u.Info = info
275267
if u.Info.Version == u.CurrentVersion {
276268
return nil
277269
}

0 commit comments

Comments
 (0)