Run attempts a self-update. It never returns an error: on success it re-executes the new binary (and does not return on Unix); on any failure or when already up to date it returns so the caller can continue with the current binary. Progress and failures are reported to stderr and slog. When a newer
(ctx context.Context, stdin io.Reader, stderr io.Writer)
| 141 | // When a newer release is available and the session is interactive, the user |
| 142 | // is prompted to confirm the upgrade; non-interactive sessions auto-confirm. |
| 143 | func Run(ctx context.Context, stdin io.Reader, stderr io.Writer) { |
| 144 | if !Enabled() { |
| 145 | return |
| 146 | } |
| 147 | New(currentVersion()).run(ctx, stdin, stderr) |
| 148 | } |
| 149 | |
| 150 | // run is the testable core. It logs and swallows every error. |
| 151 | func (u *Updater) run(ctx context.Context, stdin io.Reader, stderr io.Writer) { |
no test coverage detected