为了账号安全,请及时绑定邮箱和手机立即绑定

我已经为我的Github项目Captain设置了travis build

我已经为我的Github项目Captain设置了travis build

Go
翻阅古今 2023-07-10 16:45:53
我已经为我的Github项目Captain设置了travis build, 内容.travis.yml是:language: gogo:  - 1.12.xscript:  makeenv:  - GO111MODULE=on GOPROXY=https://proxy.golang.org我的内容Makefile是:# Go parametersBINARY_FOLDER=./binGOCMD=goGOBUILD=$(GOCMD) buildGOCLEAN=$(GOCMD) cleanGOTEST=$(GOCMD) testGOGET=$(GOCMD) getBINARY_NAME=captainBINARY_UNIX=$(BINARY_NAME)_unixall: test buildbuild:         $(GOBUILD) -o $(BINARY_FOLDER)/$(BINARY_NAME) ./cmd/...test:         $(GOTEST) -v ./...clean:         rm -rf $(BINARY_FOLDER)run: all        $(BINARY_FOLDER)/$(BINARY_NAME)# Cross compilationbuild-linux:        CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_UNIX) -vdocker-build:        docker run --rm -it -v "$(GOPATH)":/go -w /go/src/bitbucket.org/rsohlich/makepost golang:latest go build -o "$(BINARY_UNIX)" -v当 travis 构建触发时,它会出错:go test -v ./...go: finding github.com/gorilla/mux v1.7.3go: finding github.com/lib/pq v1.2.0go: finding github.com/google/uuid v1.1.1go: finding github.com/DATA-DOG/go-sqlmock v1.3.3go: downloading github.com/DATA-DOG/go-sqlmock v1.3.3go: downloading github.com/lib/pq v1.2.0go: extracting github.com/DATA-DOG/go-sqlmock v1.3.3go: extracting github.com/lib/pq v1.2.0# github.com/alwindoss/captain/cmd/captaincmd/captain/main.go:4:2: undefined: Run=== RUN   TestCreateWorklistPositiveScenario2019/08/10 14:56:19 Creating Worklist2019/08/10 14:56:19 {"id": "ID", "name": "name"}2019/08/10 14:56:19 Creating worklist in the RDBMS Store2019/08/10 14:56:19 Last Inserted ID: 12019/08/10 14:56:19 ID = 1, affected = 1--- PASS: TestCreateWorklistPositiveScenario (0.00s)=== RUN   TestCreateWorklistWhenBadRequestIsSent2019/08/10 14:56:19 Creating Worklist2019/08/10 14:56:19 This is a bad request--- PASS: TestCreateWorklistWhenBadRequestIsSent (0.00s)PASSok      github.com/alwindoss/captain/internal/handler   0.005sMakefile:15: recipe for target 'test' failedmake: *** [test] Error 2在作业日志中,我看到所有测试都通过了,但构建并未超出此范围。Makefile在我的 Mac 上本地运行也没有问题。我不确定问题出在哪里。在 Makefile 中或以我配置 Travis CI 的方式。
查看完整描述

1 回答

?
胡子哥哥

TA贡献1825条经验 获得超6个赞

有趣的错误消息是:

cmd/captain/main.go:4:2: undefined: Run

因此,在您的第 4 行main.go,您引用了一个未定义的符号Run


查看完整回答
反对 回复 2023-07-10
  • 1 回答
  • 0 关注
  • 93 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信