github.com/zxy12/go_duplicate_112_new@v0.0.0-20200807091221-747231827200/src/cmd/go/testdata/script/mod_why.txt (about) 1 env GO111MODULE=on 2 3 go list -test all 4 stdout rsc.io/quote 5 stdout golang.org/x/text/language 6 7 # why a package? 8 go mod why golang.org/x/text/language 9 cmp stdout why-language.txt 10 11 # why a module? 12 go mod why -m golang.org... 13 cmp stdout why-text-module.txt 14 15 # why a package used only in tests? 16 go mod why rsc.io/testonly 17 cmp stdout why-testonly.txt 18 19 # why a module used only in tests? 20 go mod why -m rsc.io/testonly 21 cmp stdout why-testonly.txt 22 23 # test package not needed 24 go mod why golang.org/x/text/unused 25 cmp stdout why-unused.txt 26 27 # vendor doesn't use packages used only in tests. 28 go mod why -vendor rsc.io/testonly 29 cmp stdout why-vendor.txt 30 31 # vendor doesn't use modules used only in tests. 32 go mod why -vendor -m rsc.io/testonly 33 cmp stdout why-vendor-module.txt 34 35 # test multiple packages 36 go mod why golang.org/x/text/language golang.org/x/text/unused 37 cmp stdout why-both.txt 38 39 # test multiple modules 40 go mod why -m rsc.io/quote rsc.io/sampler 41 cmp stdout why-both-module.txt 42 43 -- go.mod -- 44 module mymodule 45 require rsc.io/quote v1.5.2 46 47 -- x/x.go -- 48 package x 49 import _ "mymodule/z" 50 51 -- y/y.go -- 52 package y 53 54 -- y/y_test.go -- 55 package y 56 import _ "rsc.io/quote" 57 58 -- z/z.go -- 59 package z 60 import _ "mymodule/y" 61 62 63 -- why-language.txt -- 64 # golang.org/x/text/language 65 mymodule/y 66 mymodule/y.test 67 rsc.io/quote 68 rsc.io/sampler 69 golang.org/x/text/language 70 -- why-unused.txt -- 71 # golang.org/x/text/unused 72 (main module does not need package golang.org/x/text/unused) 73 -- why-text-module.txt -- 74 # golang.org/x/text 75 mymodule/y 76 mymodule/y.test 77 rsc.io/quote 78 rsc.io/sampler 79 golang.org/x/text/language 80 -- why-testonly.txt -- 81 # rsc.io/testonly 82 mymodule/y 83 mymodule/y.test 84 rsc.io/quote 85 rsc.io/sampler 86 rsc.io/sampler.test 87 rsc.io/testonly 88 -- why-vendor.txt -- 89 # rsc.io/testonly 90 (main module does not need to vendor package rsc.io/testonly) 91 -- why-vendor-module.txt -- 92 # rsc.io/testonly 93 (main module does not need to vendor module rsc.io/testonly) 94 -- why-both.txt -- 95 # golang.org/x/text/language 96 mymodule/y 97 mymodule/y.test 98 rsc.io/quote 99 rsc.io/sampler 100 golang.org/x/text/language 101 102 # golang.org/x/text/unused 103 (main module does not need package golang.org/x/text/unused) 104 -- why-both-module.txt -- 105 # rsc.io/quote 106 mymodule/y 107 mymodule/y.test 108 rsc.io/quote 109 110 # rsc.io/sampler 111 mymodule/y 112 mymodule/y.test 113 rsc.io/quote 114 rsc.io/sampler