Enabled reports whether the self-update mechanism should run for this process. It is false when disabled by env, or when this process is already the re-executed child of a prior update (loop guard).
()
| 127 | // process. It is false when disabled by env, or when this process is already |
| 128 | // the re-executed child of a prior update (loop guard). |
| 129 | func Enabled() bool { |
| 130 | if os.Getenv(envReExecMarker) != "" { |
| 131 | return false |
| 132 | } |
| 133 | return isTruthy(os.Getenv(EnvAutoUpdate)) |
| 134 | } |
| 135 | |
| 136 | // Run attempts a self-update. It never returns an error: on success it |
| 137 | // re-executes the new binary (and does not return on Unix); on any failure or |