MCPcopy Create free account
hub / github.com/Melkeydev/govm / DeleteVersion

Function DeleteVersion

internal/utils/utils.go:355–371  ·  view source on GitHub ↗
(version GoVersion)

Source from the content-addressed store, hash-verified

353}
354
355func DeleteVersion(version GoVersion) tea.Cmd {
356 return func() tea.Msg {
357 if !version.Installed {
358 return ErrMsg(fmt.Errorf("version %s is not installed", version.Version))
359 }
360
361 if version.Active {
362 return ErrMsg(fmt.Errorf("cannot delete active version - switch to another version first"))
363 }
364
365 if err := os.RemoveAll(version.Path); err != nil {
366 return ErrMsg(fmt.Errorf("failed to delete version %s: %v", version.Version, err))
367 }
368
369 return DeleteCompleteMsg{Version: version.Version}
370 }
371}

Callers 2

UpdateMethod · 0.92
DeleteVersionFunction · 0.92

Calls 1

ErrMsgTypeAlias · 0.85

Tested by

no test coverage detected