我正在关注http://tour.golang.org/,直到我进入第三步,告诉你可以在你的系统上安装gotour.之后我通过以下方式安装了go语言:
brew install hg
brew install go
Run Code Online (Sandbox Code Playgroud)
然后我通过以下方式下载了我们的
go get code.google.com/p/go-tour/gotour
Run Code Online (Sandbox Code Playgroud)
当我试图启动它时,它没有识别命令:
$ gotour
-bash: gotour: command not found
Run Code Online (Sandbox Code Playgroud)
和
$ go gotour
Run Code Online (Sandbox Code Playgroud)
和
$ ./gotour
Run Code Online (Sandbox Code Playgroud)
所以我试图看到go路径,它是空的,
echo $GOPATH
Run Code Online (Sandbox Code Playgroud)
所以我定义了GOPATH:
GOPATH=/usr/local/Cellar/go/1.0.2/src/pkg/code.google.com/p/
export GOPATH
Run Code Online (Sandbox Code Playgroud)
现在我可以通过跑步来运行
./gotour
Run Code Online (Sandbox Code Playgroud)
但是我对自己的环境没有安全感......我不是因为能够奔跑而活着的
go run gotour
Run Code Online (Sandbox Code Playgroud)
或者只是打字(就像在这个网站上描述的那样http://www.moncefbelyamani.com/how-to-install-the-go-tour-on-your-mac/):
gotour
Run Code Online (Sandbox Code Playgroud)
我想知道我是不是以正确的方式做事,因为我是go the programing语言的新手.
depends_on
在父服务测试完成后不使用,是否可以告诉 docker compose 终止阵列上指定的服务--abort-on-container-exit
?
我正在尝试构建一个从多个应用程序运行测试的 docker 文件,例如:
services:
test-spa:
build:
context: ./spa
dockerfile: Dockerfile.test
command: ["yarn", "run", "test", "--watch", "false"]
lint:
build:
context: ./spa
dockerfile: Dockerfile.test
command: ["yarn", "run", "lint"]
build:
build:
context: ./spa
dockerfile: Dockerfile.test
command: ["yarn", "run", "build", "--prod"]
test-backend:
build:
context: ./backend
dockerfile: Dockerfile.dev
entrypoint: [scripts/entrypoint.sh]
command: bundle exec rails test
depends_on:
- db
db:
image: postgres
Run Code Online (Sandbox Code Playgroud)
问题是作为依赖项test-backend
启动db
服务,运行其测试,退出并db
永远不会完成。
使用--abort-on-container-exit
不是一种选择,因为spa
相关服务可能会在test-backend
结束之前退出。