1 # go.dev/issue/78805: 'go get' was following plain-HTTP URLs even without GOINSECURE.
2
3 env GOPROXY=direct
4 env GONOSUMDB=vcs-test.golang.org
5
6 # By default it should get rejected due to an insecure schema.
7 ! go get vcs-test.golang.org/go/insecure/insecure2
8 stderr 'unrecognized import path "vcs-test.golang.org/go/insecure/insecure2": go-import meta tag specifies repository URL "http://vcs-test.golang.org/insecure" with insecure scheme, but module path "vcs-test.golang.org/go/insecure/insecure2" is not matched by the GOINSECURE environment variable; see ''go help environment'''
9 ! stderr 'Not Found'
10 ! stderr '@v/list'
11
12 # Setting a mismatching GOINSECURE shouldn't make a difference.
13 env GOINSECURE=vcs-test.golang.org/*/*/insecure2not
14 ! go get vcs-test.golang.org/go/insecure/insecure2
15 stderr 'unrecognized import path "vcs-test.golang.org/go/insecure/insecure2": go-import meta tag specifies repository URL "http://vcs-test.golang.org/insecure" with insecure scheme, but module path "vcs-test.golang.org/go/insecure/insecure2" is not matched by the GOINSECURE environment variable; see ''go help environment'''
16 ! stderr 'Not Found'
17 ! stderr '@v/list'
18
19 # Setting a matching GOINSECURE should make it try and fetch the module.
20 # (Though its source doesn't exist, so just confirm it fails in the expected way.)
21 env GOINSECURE=vcs-test.golang.org/*/*/insecure2
22 ! go get vcs-test.golang.org/go/insecure/insecure2
23 ! stderr GOINSECURE
24 stderr 'Not Found'
25 stderr '@v/list'
26
27 -- go.mod --
28 module test
29
30 go 1.25.0
31
View as plain text