我有这个目录结构:

https://github.com/netjet-chrome-extension/netjet-mono/tree/master/examples/projects/golang

我尝试运行test.sh,其中包括:

#!/usr/bin/env bash

cd "$(dirname "$BASH_SOURCE")"
export GOPATH="$PWD"
go test sourcegraph_go_selenium

但我得到这个错误:

无法加载软件包:软件包sourcegraph_go_selenium:找不到
将“sourcegraph_go_selenium”打包为以下任何一种:
/usr/lib/go-1.10/src/sourcegraph_go_selenium(来自$ GOROOT)
/ home / oleg / codes / netjet / netjet-mono / examples / projects / golang / src / sourcegraph_go_selenium
(来自$ GOPATH)

GOPATH设置正确,那么为什么找不到sourcegraph_go_selenium包?这个包就在那儿,用src/sourcegraph_go_selenium ...?

最佳答案

尝试这个:

go test sourcegraph_go_selenium/...

09-17 13:30