Skip to content

Commit

Permalink
Merge pull request #143 from ondrej-fabry/patch-1
Browse files Browse the repository at this point in the history
Update running-without-go.md
  • Loading branch information
dnephin committed Sep 3, 2020
2 parents 4bafc65 + 7009f6a commit 1363245
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/running-without-go.md
Original file line number Diff line number Diff line change
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 1363245

Please sign in to comment.