Skip to content

Commit

Permalink
testscript: update docs on set variables
Browse files Browse the repository at this point in the history
We have been setting `/`, `:`, and `$` for some time,
but they weren't documented. Do that.

`goversion` doesn't belong here, as it was moved to `gotooltest`.

`TMPDIR` was slightly wrong; it has started with a period for some time,
to ensure that tools like `go list ./...` don't descend into it.
  • Loading branch information
mvdan committed Aug 22, 2022
1 parent c16c0a2 commit 7a6a5f8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions testscript/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ As an example:
Each script runs in a fresh temporary work directory tree, available to scripts as $WORK.
Scripts also have access to these other environment variables:
HOME=/no-home
PATH=<actual PATH>
TMPDIR=$WORK/tmp
HOME=/no-home
TMPDIR=$WORK/.tmp
devnull=<value of os.DevNull>
goversion=<current Go version; for example, 1.12>
/=<value of os.PathSeparator>
:=<value of os.PathListSeparator>
$=$
The environment variable $exe (lowercase) is an empty string on most
systems, ".exe" on Windows.
Expand Down

0 comments on commit 7a6a5f8

Please sign in to comment.