我不确定这是否是发布此类问题的正确位置。
我试图在 CircleCI 上测试我的 golang 项目。在 阶段dependencies
,CI 执行
go get -u github.com/aws/aws-sdk-go/...
并且发生了错误:
package github.com/aws/aws-sdk-go/...
imports github.com/aws/aws-sdk-go/aws
imports github.com/aws/aws-sdk-go/aws/awserr: /home/ubuntu/sprocket-analytics-data-pipeline-v2/src/go/src/github.com/aws/aws-sdk-go is from git@github.com:aws/aws-sdk-go, should be from https://github.com/aws/aws-sdk-go
错误很长,上面的代码只是其中的一部分。
因此,我更新了我circleci.yml
的以覆盖依赖项阶段。circleci.yml
就像:
machine:
timezone:
Asia/Tokyo
environment:
GOPATH: /home/ubuntu/my-project/src/go
dependencies:
override:
- go get github.com/go-sql-driver/mysql
- go get github.com/google/google-api-go-client/bigquery/v2
- go get code.google.com/p/goauth2/oauth/jwt
- go get golang.org/x/tools/cmd/cover
- go get github.com/AlekSi/gocov-xml
- go get github.com/jstemmer/go-junit-report
- go get github.com/golang/mock/gomock
- go get github.com/onsi/gomega
- go get github.com/onsi/ginkgo/ginkgo
- go get github.com/aws/aws-sdk-go/...
- go get github.com/axw/gocov/...
test:
pre:
- go install path/to/the/package
override:
- go test /home/ubuntu/my-project/src/go/src/path/to/the/package
在go get github.com/aws/aws-sdk-go/...
我的配置中运行良好。
但是,在我执行完所有命令之后circleci.yml
,go get -u github.com/aws/aws-sdk-go/...
还是被 CI 执行了。它再次失败并出现同样的错误。
这是来自 CircleCI 的日志:
有什么可以绕行的吗?还是我错过了一些东西,比如配置地址以获取 go 包(根据错误消息)?
提前致谢!