Batch file 与jenkins一起构建Go项目,它报告了一个错误,该错误导致';在cmd或goland建造时不报告

Batch file 与jenkins一起构建Go项目,它报告了一个错误,该错误导致';在cmd或goland建造时不报告,batch-file,go,jenkins,Batch File,Go,Jenkins,当我在jenkins中使用bat构建go项目时,它会报告一个错误: go tool: no such tool "asm" 但是,当我单独使用cmd或goland构建go项目时,错误不会发生,为什么会发生这个错误 詹金斯的命令是 C:/Users/Administrator/Desktop/build.bat bat的内容是: @echo off cd C:/Users/Administrator/Desktop/GOPATH/src/Flipped_Server/main go buil

当我在jenkins中使用bat构建go项目时,它会报告一个错误:

go tool: no such tool "asm"
但是,当我单独使用cmd或goland构建go项目时,错误不会发生,为什么会发生这个错误

詹金斯的命令是

C:/Users/Administrator/Desktop/build.bat
bat的内容是:

@echo off 
cd C:/Users/Administrator/Desktop/GOPATH/src/Flipped_Server/main
go build main.go
xcopy main.exe "C:/Users/Administrator/Desktop/Flipped-Server" /s /e /c /y /h /r
echo "Succeed to build and deploy the flipped-Server"

当我取消选中该选项时

Set up Go Programming language tools
它起作用了!成功构建

N.B.:Windows路径分隔符是
\
,但不是
/
;您应该使用
cd/D C:\…
而不是
cd C:\…
,以便在当前正在使用另一个驱动器时也可以更改驱动器…