Skip to content

Commit 05362d9

Browse files
committed
readme: add caveat on how parallel wgo commands must be started with "wgo" and not anything else
Fixes #17.
1 parent 8392422 commit 05362d9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,27 @@ $ wgo run main.go \
241241
:: wgo -file .ts tsc 'assets/*.ts' --outfile assets/index.js
242242
```
243243

244+
### NOTE: It specifically has to be "wgo" directly after "::" for a parallel command to be started
245+
246+
Even if wgo was invoked with `go tool wgo` or its full binary path (e.g. `/usr/local/bin/wgo`), wgo only recognizes the magic string `"wgo"` after the `"::"` as the signal to start a new parallel command (otherwise it is treated as a chained command).
247+
248+
249+
```shell
250+
# ❌ These do not start parallel wgo commands. Do not nest wgo commands like this.
251+
$ go tool wgo echo 1 :: go tool wgo echo 2 :: go tool wgo echo 3
252+
$ /usr/local/bin/wgo echo 1 :: /usr/local/bin/wgo echo 2 :: /usr/local/bin/wgo echo 3
253+
254+
# ✅ These start parallel wgo commands.
255+
$ wgo echo 1 :: wgo echo 2 :: wgo echo 3
256+
$ go tool wgo echo 1 :: wgo echo 2 :: wgo echo 3
257+
$ /usr/local/bin/wgo echo 1 :: wgo echo 2 :: wgo echo 3
258+
# └┬┘ └┬┘
259+
# └──────┬──────┘
260+
# This is not spawning a separate wgo process, it is a placeholder string
261+
# recognized by the wgo binary, which is in turn responsible for running all the
262+
# specified commands in parallel. There is only ever one parent wgo process.
263+
```
264+
244265
## Running commands in a different directory
245266

246267
[*back to flags index*](#flags)

0 commit comments

Comments
 (0)