...
1env TEST_GODOC_URL_FILE=$WORK/url.txt
2
3# Outside of a module.
4go doc -http
5grep '/std' $TEST_GODOC_URL_FILE
6
7# Inside a module with a major version suffix.
8# We should use the major version suffix rather than
9# the location in the gopath (#75976).
10cd example.com/m
11go doc -http
12grep '/example.com/m/v5' $TEST_GODOC_URL_FILE
13go doc -http .
14grep '/example.com/m/v5' $TEST_GODOC_URL_FILE
15
16# In GOPATH mode, we should use the location in the GOPATH.
17env GO111MODULE=off
18go doc -http
19grep '/std' $TEST_GODOC_URL_FILE
20# TODO(matloob): This should probably this be the same as 'go doc -http .'
21! grep '/example.com/m' $TEST_GODOC_URL_FILE
22go doc -http .
23grep '/example.com/m' $TEST_GODOC_URL_FILE
24! grep '/example.com/m/v5' $TEST_GODOC_URL_FILE
25
26-- example.com/m/go.mod --
27module example.com/m/v5
28
29go 1.27
30-- example.com/m/m.go --
31package mView as plain text