Skip to content

Commit

Permalink
Update running-without-go.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrej-fabry committed Aug 27, 2020
1 parent 5d0850c commit 7009f6a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/running-without-go.md
Expand Up @@ -3,17 +3,25 @@
`gotestsum` may be run without Go as long as the package to be tested has
already been compiled using `go test -c`, and the `test2json` tool is available.

The `test2json` tool can be compiled from the Go source tree.
The `test2json` tool can be compiled from the Go source tree:

```sh
curl -Lo go.zip "https://github.com/golang/go/archive/go1.13.5.zip"
export GOVERSION=1.13.5
curl -Lo go.zip "https://github.com/golang/go/archive/go${GOVERSION}.zip"
unzip go.zip
rm -f go.zip
cd go-go1.13.5/src/cmd/test2json/
cd go-go${GOVERSION}/src/cmd/test2json/
env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" .
mv test2json /usr/local/bin/test2json
```

Or if you have Go installed already:

```sh
env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o test2json -ldflags="-s -w" cmd/test2json
mv test2json /usr/local/bin/test2json
```

Example: running without a Go installation
```
export GOVERSION=1.13
Expand Down

0 comments on commit 7009f6a

Please sign in to comment.