github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/mod_go_version.txt (about) 1 # Test support for declaring needed Go version in module. 2 3 env GO111MODULE=on 4 5 go list 6 go build 7 go build sub.1 8 go build subver.1 9 ! stderr 'module requires' 10 ! go build badsub.1 11 stderr 'module requires Go 1.11111' 12 13 go build versioned.1 14 go mod edit -require versioned.1@v1.1.0 15 ! go build versioned.1 16 stderr 'module requires Go 1.99999' 17 18 -- go.mod -- 19 module m 20 go 1.999 21 require ( 22 sub.1 v1.0.0 23 subver.1 v1.0.0 24 badsub.1 v1.0.0 25 versioned.1 v1.0.0 26 ) 27 replace ( 28 sub.1 => ./sub 29 subver.1 => ./subver 30 badsub.1 => ./badsub 31 versioned.1 v1.0.0 => ./versioned1 32 versioned.1 v1.1.0 => ./versioned2 33 ) 34 35 -- x.go -- 36 package x 37 38 -- sub/go.mod -- 39 module m 40 go 1.11 41 42 -- sub/x.go -- 43 package x 44 45 -- subver/go.mod -- 46 module m 47 go 1.11111 48 49 -- subver/x.go -- 50 package x 51 52 -- badsub/go.mod -- 53 module m 54 go 1.11111 55 56 -- badsub/x.go -- 57 package x 58 invalid syntax 59 60 -- versioned1/go.mod -- 61 module versioned 62 go 1.0 63 64 -- versioned1/x.go -- 65 package x 66 67 -- versioned2/go.mod -- 68 module versioned 69 go 1.99999 70 71 -- versioned2/x.go -- 72 package x 73 invalid syntax