← 返回博客列表

撤消 go install 安装的包

·后端开发·2 分钟阅读

具体步骤

首先要明确需要删除的是哪个包,这里以 hello 为例,可以根据实际情况修改

  1. 使用 which 命令查看包路径
which hello

# output 
# /Users/fuxiaochen/go/bin/hello
  1. 使用 rm 令删除对应文件
rm -rf $(which hello)
  1. 再次执行命令,检查是否删除成功
hello

# output 出现 command not found 说明已删除
# command not found: hello

参考链接

Golang
撤消 go install 安装的包 | 付小晨