1 # Don't allow the creation of modules with special "go" or "toolchain" paths.
2 ! go mod init go
3 ! stderr 'panic'
4 stderr 'invalid module path'
5
6 ! go mod init toolchain
7 ! stderr 'panic'
8 stderr 'invalid module path'
9
10 # A module that contains the path element "go" is okay.
11 go mod init example.com/go
12 stderr 'creating new go.mod'
13
14 # go mod edit won't allow a reserved module path either
15 ! go mod edit -module=go
16 stderr '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.
20 cp badmod.txt go.mod
21 ! go list
22 ! stderr panic
23 stderr 'invalid module path'
24
25 -- badmod.txt --
26 module go
27
View as plain text