Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Testing Go,Golang:travis主程序出错,Go get-v_Testing_Go_Travis Ci - Fatal编程技术网

Testing Go,Golang:travis主程序出错,Go get-v

Testing Go,Golang:travis主程序出错,Go get-v,testing,go,travis-ci,Testing,Go,Travis Ci,在我的repo的子目录中,我有一些带有package main的脚本来展示我的包的一些示例用法。但在Travis上测试时,这给了我以下错误 repo example-dir sub-dir main.go // this gives me error like the following github.com/~/主程序目录 命令“go get-v./…”失败。重试,第2次,共3次。 我只在Travis中看到这个错误,而在本地机器上没有看到go te

在我的repo的子目录中,我有一些带有
package main
的脚本来展示我的包的一些示例用法。但在Travis上测试时,这给了我以下错误

 repo

 example-dir
      sub-dir
          main.go  // this gives me error like the following

github.com/~/主程序目录
命令“go get-v./…”失败。重试,第2次,共3次。

我只在Travis中看到这个错误,而在本地机器上没有看到
go test


是否仍有办法分离主程序并仍然能够通过Travis测试?

main.go
中使用正确的路径,这是禁用该文件的正确方法:

// +build local

package main

//other code

然后使用
go-build-tags-local
go-run-tags-local

在代码中使用的导入路径不正确。