MCPcopy Index your code
hub / github.com/voidint/g / uninstall

Function uninstall

cli/uninstall.go:30–46  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

28)
29
30func uninstall(ctx *cli.Context) error {
31 vname := ctx.Args().First()
32 if vname == "" {
33 return cli.ShowSubcommandHelp(ctx)
34 }
35 targetV := filepath.Join(versionsDir, vname)
36
37 if finfo, err := os.Stat(targetV); err != nil || !finfo.IsDir() {
38 return cli.Exit(fmt.Sprintf("[g] %q version is not installed", vname), 1)
39 }
40
41 if err := os.RemoveAll(targetV); err != nil {
42 return cli.Exit(wrapstring(fmt.Sprintf("Uninstall failed: %s", err.Error())), 1)
43 }
44 fmt.Printf("Uninstalled go%s\n", vname)
45 return nil
46}

Callers

nothing calls this directly

Calls 2

wrapstringFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…