...
1# Don't allow the creation of modules with special "go" or "toolchain" paths.
2! go mod init go
3! stderr 'panic'
4stderr 'invalid module path'
5
6! go mod init toolchain
7! stderr 'panic'
8stderr 'invalid module path'
9
10# A module that contains the path element "go" is okay.
11go mod init example.com/go
12stderr 'creating new go.mod'
13
14# go mod edit won't allow a reserved module path either
15! go mod edit -module=go
16stderr 'invalid -module'
17
18# The go command should check for work modules for bad
19# names to return a proper error and avoid a panic.
20cp badmod.txt go.mod
21! go list
22! stderr panic
23stderr 'invalid module path'
24
25-- badmod.txt --
26module go
View as plain text