...
1This directory holds Go modules served by a Go module proxy
2that runs on localhost during tests, both to make tests avoid
3requiring specific network servers and also to make them
4significantly faster.
5
6A small go get'able test module can be added here by running
7
8 cd cmd/go/testdata
9 go run addmod.go path@vers
10
11where path and vers are the module path and version to add here.
12
13For interactive experimentation using this set of modules, run:
14
15 cd cmd/go
16 go test -proxy=localhost:1234 &
17 export GOPROXY=http://localhost:1234/mod
18
19and then run go commands as usual.
20
21Modules saved to this directory should be small: a few kilobytes at most.
22It is acceptable to edit the archives created by addmod.go to remove
23or shorten files. It is also acceptable to write module archives by hand:
24they need not be backed by some public git repo.
25
26Each module archive is named path_vers.txt, where slashes in path
27have been replaced with underscores. The archive must contain
28two files ".info" and ".mod", to be served as the info and mod files
29in the proxy protocol (see https://research.swtch.com/vgo-module).
30The remaining files are served as the content of the module zip file.
31The path@vers prefix required of files in the zip file is added
32automatically by the proxy: the files in the archive have names without
33the prefix, like plain "go.mod", "x.go", and so on.
34
35See ../addmod.go and ../savedir.go for tools to generate txtar files,
36although again it is also fine to write them by hand.
View as plain text