docs: document packages, exported API and non-obvious logic

This commit is contained in:
Mathis Maquenne
2026-08-06 13:04:10 +02:00
parent 5dfd832d0d
commit b1ad9b4904
41 changed files with 757 additions and 7 deletions
+8
View File
@@ -38,6 +38,14 @@ func newUpdateCmd() *cobra.Command {
return cmd
}
// runUpdate reports the current and latest versions and installs the update.
//
// Whether the binary can be replaced at all is checked before the network
// call, so a package-managed install is told so straight away instead of
// after a pointless round trip.
//
// The force check comes before the check-only one so that `--check --force`
// still just reports rather than installing.
func runUpdate(ctx context.Context, opts *updateOptions) error {
if err := update.CheckUpdatable(); err != nil {
return err