今天git commit时出现以下错误:

.husky/pre-commit: line 4: golangci-lint: command not found 
husky - pre-commit hook exited with code 127 (error)

在这里插入图片描述
原因:mentor更改了husky中的内容

下载

golangci-lint.run官方文档里提供了下载方案(包括windows、linux等,我这里直接使用go下载)
在这里插入图片描述

安装

安装双击下图中的install.sh脚本(我的安装路径在go下:D:\go\bin\go\pkg\mod\github.com\golangci\golangci-lint@v1.47.2)
在这里插入图片描述
注意这里要连接github,由于GFW的原因可能会失败,建议设置终端代理

加入环境变量

golangci-lint的配置

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐