我有一个Makefile正在circleci上运行一些目标这是的目标Makefileinstall_lint: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0当我在第二个目标上运行时golangci-lint --version出现错误golangci-lint: Command not found我也尝试过这个curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0因为我正在运行 docker1.13.2version: 2jobs: build: docker: - image: circleci/golang:1.13.3知道我在这里缺少什么吗?如何使二进制可用?我也尝试过类似的东西install_lint: curl -sLO https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_VERSION}/golangci-lint-${GOLANGCI_VERSION}-linux-amd64.tar.gz tar -xzvf golangci-lint-${GOLANGCI_VERSION}-linux-amd64.tar.gz cp golangci-lint-${GOLANGCI_VERSION}-linux-amd64/golangci-lint /usr/local/bin/golangci-lint && chmod +x /usr/local/bin/golangci-lint我得到了错误cp: cannot create regular file '/usr/local/bin/golangci-lint': Permission denied
1 回答
一只萌萌小番薯
TA贡献1795条经验 获得超7个赞
我这样做的方式是
1-我让circle CI安装golangci-lint
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.20.0
2-我的 make 文件只有 golangci-lint 调用
lint:
@golangci-lint run
3 圈 CI 步骤调用我的 makefile
validate-lint:
...
steps:
- run:
name: "Validate lint"
command: |
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.20.0
make lint
- 1 回答
- 0 关注
- 125 浏览
添加回答
举报
0/150
提交
取消