With Go 1.14 (https://tip.golang.org/doc/go1.14#go-command),
it now automatically checks for the existence of a vendor directory.

So there is no need to explicitly set the `-mod=vendor` flag.
Этот коммит содержится в:
Agniva De Sarker
2020-04-07 09:01:06 +05:30
коммит произвёл GitHub
родитель d1d1e3d27a
Коммит 125ed3a4cf
5 изменённых файлов: 124 добавлений и 4 удалений

Просмотреть файл

@@ -33,7 +33,7 @@ func CompileGo(t *testing.T, sourceCode, outputPath string) {
serverPath := filepath.Dir(filepath.Dir(sourceFile))
out := &bytes.Buffer{}
cmd := exec.Command("go", "build", "-mod=vendor", "-o", outputPath, main)
cmd := exec.Command("go", "build", "-o", outputPath, main)
cmd.Dir = serverPath
cmd.Stdout = out
cmd.Stderr = out