func (u *Updater) wantUpdate() bool { path := filepath.Join(updateDir, upcktimePath) if !version.Tagged() || readTime(path).After(time.Now()) { return false } wait := 12*time.Hour + randDuration(8*time.Hour) return writeTime(path, time.Now().Add(wait)) }
func runUpdate() error { if updater == nil || !version.Tagged() { return errors.New("Dev builds don't support auto-updates") } return updater.update() }