rogpeppe / go-internal

Selected Go-internal packages factored out from the standard library
BSD 3-Clause "New" or "Revised" License
823 stars 67 forks source link

Command go allowed in some txtar scripts and not in others, please document #234

Closed rudifa closed 2 months ago

rudifa commented 10 months ago

I was intrigued by the difference between .txtar files intended for running with testscript first.txtar and those intended for running with go test other.txtar.

The files ran by testscript support the command go with a variety of arguments, as documented in testscript -h, in addition to commands, conditions and supporting files that are interpreted by the small script engine in the testscript package; files run by go test do not support the command go.

I suggest that this difference should be mentioned and documented in testscript doc, for the benefit of newcomers.

mvdan commented 3 months ago

The difference is https://pkg.go.dev/github.com/rogpeppe/go-internal/gotooltest. It's true that the gotooltest package is not linked from the testscript package's documentation, so I'd happily approve a small patch doing that.

mvdan commented 2 months ago

Your PR above clarified this.