| 1 |
# cmd/doc should use GOROOT to locate the 'go' command, |
| 2 |
# not use whatever is in $PATH. |
| 3 |
|
| 4 |
# Remove 'go' from $PATH. (It can still be located via $GOROOT/bin/go, and the |
| 5 |
# test script's built-in 'go' command still knows where to find it.) |
| 6 |
env PATH='' |
| 7 |
[GOOS:plan9] env path='' |
| 8 |
|
| 9 |
go doc p.X |
| 10 |
|
| 11 |
-- go.mod -- |
| 12 |
module example |
| 13 |
|
| 14 |
go 1.19 |
| 15 |
|
| 16 |
require example.com/p v0.1.0 |
| 17 |
|
| 18 |
replace example.com/p => ./pfork |
| 19 |
-- example.go -- |
| 20 |
package example |
| 21 |
|
| 22 |
import _ "example.com/p" |
| 23 |
-- pfork/go.mod -- |
| 24 |
module example.com/p |
| 25 |
|
| 26 |
go 1.19 |
| 27 |
-- pfork/p.go -- |
| 28 |
package p |
| 29 |
|
| 30 |
const X = 42 |