summaryrefslogtreecommitdiff
path: root/libgo/go/cmd
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-01-02 15:05:27 -0800
committerIan Lance Taylor <iant@golang.org>2020-01-21 23:53:22 -0800
commit5a8ea165926cb0737ab03bc48c18dc5198ab5305 (patch)
tree962dc3357c57f019f85658f99e2e753e30201c27 /libgo/go/cmd
parent6ac6529e155c9baa0aaaed7aca06bd38ebda5b43 (diff)
libgo: update to Go1.14beta1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/214297
Diffstat (limited to 'libgo/go/cmd')
-rw-r--r--libgo/go/cmd/cgo/doc.go4
-rw-r--r--libgo/go/cmd/cgo/gcc.go21
-rw-r--r--libgo/go/cmd/cgo/out.go12
-rw-r--r--libgo/go/cmd/go/alldocs.go87
-rw-r--r--libgo/go/cmd/go/go_test.go905
-rw-r--r--libgo/go/cmd/go/help_test.go2
-rw-r--r--libgo/go/cmd/go/internal/base/flag.go5
-rw-r--r--libgo/go/cmd/go/internal/base/signal_unix.go2
-rw-r--r--libgo/go/cmd/go/internal/cache/cache.go69
-rw-r--r--libgo/go/cmd/go/internal/cfg/cfg.go15
-rw-r--r--libgo/go/cmd/go/internal/clean/clean.go2
-rw-r--r--libgo/go/cmd/go/internal/dirhash/hash.go103
-rw-r--r--libgo/go/cmd/go/internal/dirhash/hash_test.go135
-rw-r--r--libgo/go/cmd/go/internal/doc/doc.go2
-rw-r--r--libgo/go/cmd/go/internal/envcmd/env.go69
-rw-r--r--libgo/go/cmd/go/internal/fmtcmd/fmt.go6
-rw-r--r--libgo/go/cmd/go/internal/generate/generate.go2
-rw-r--r--libgo/go/cmd/go/internal/get/discovery.go16
-rw-r--r--libgo/go/cmd/go/internal/get/get.go6
-rw-r--r--libgo/go/cmd/go/internal/get/path.go5
-rw-r--r--libgo/go/cmd/go/internal/get/vcs.go78
-rw-r--r--libgo/go/cmd/go/internal/help/helpdoc.go16
-rw-r--r--libgo/go/cmd/go/internal/imports/build.go4
-rw-r--r--libgo/go/cmd/go/internal/list/list.go18
-rw-r--r--libgo/go/cmd/go/internal/load/pkg.go251
-rw-r--r--libgo/go/cmd/go/internal/load/pkg_test.go44
-rw-r--r--libgo/go/cmd/go/internal/load/test.go17
-rw-r--r--libgo/go/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go2
-rw-r--r--libgo/go/cmd/go/internal/lockedfile/lockedfile.go65
-rw-r--r--libgo/go/cmd/go/internal/lockedfile/lockedfile_test.go4
-rw-r--r--libgo/go/cmd/go/internal/lockedfile/transform_test.go104
-rw-r--r--libgo/go/cmd/go/internal/modcmd/download.go58
-rw-r--r--libgo/go/cmd/go/internal/modcmd/edit.go58
-rw-r--r--libgo/go/cmd/go/internal/modcmd/graph.go10
-rw-r--r--libgo/go/cmd/go/internal/modcmd/init.go8
-rw-r--r--libgo/go/cmd/go/internal/modcmd/mod.go9
-rw-r--r--libgo/go/cmd/go/internal/modcmd/tidy.go32
-rw-r--r--libgo/go/cmd/go/internal/modcmd/vendor.go78
-rw-r--r--libgo/go/cmd/go/internal/modcmd/verify.go14
-rw-r--r--libgo/go/cmd/go/internal/modcmd/why.go10
-rw-r--r--libgo/go/cmd/go/internal/modconv/convert.go7
-rw-r--r--libgo/go/cmd/go/internal/modconv/convert_test.go5
-rw-r--r--libgo/go/cmd/go/internal/modconv/dep.go6
-rw-r--r--libgo/go/cmd/go/internal/modconv/glide.go4
-rw-r--r--libgo/go/cmd/go/internal/modconv/glock.go4
-rw-r--r--libgo/go/cmd/go/internal/modconv/godeps.go4
-rw-r--r--libgo/go/cmd/go/internal/modconv/modconv.go2
-rw-r--r--libgo/go/cmd/go/internal/modconv/tsv.go4
-rw-r--r--libgo/go/cmd/go/internal/modconv/vconf.go4
-rw-r--r--libgo/go/cmd/go/internal/modconv/vjson.go4
-rw-r--r--libgo/go/cmd/go/internal/modconv/vmanifest.go4
-rw-r--r--libgo/go/cmd/go/internal/modconv/vyml.go4
-rw-r--r--libgo/go/cmd/go/internal/modfetch/bootstrap.go2
-rw-r--r--libgo/go/cmd/go/internal/modfetch/cache.go62
-rw-r--r--libgo/go/cmd/go/internal/modfetch/codehost/codehost.go7
-rw-r--r--libgo/go/cmd/go/internal/modfetch/codehost/git.go125
-rw-r--r--libgo/go/cmd/go/internal/modfetch/codehost/git_test.go27
-rw-r--r--libgo/go/cmd/go/internal/modfetch/codehost/shell.go2
-rw-r--r--libgo/go/cmd/go/internal/modfetch/codehost/svn.go154
-rw-r--r--libgo/go/cmd/go/internal/modfetch/codehost/vcs.go104
-rw-r--r--libgo/go/cmd/go/internal/modfetch/coderepo.go310
-rw-r--r--libgo/go/cmd/go/internal/modfetch/coderepo_test.go378
-rw-r--r--libgo/go/cmd/go/internal/modfetch/fetch.go216
-rw-r--r--libgo/go/cmd/go/internal/modfetch/insecure.go16
-rw-r--r--libgo/go/cmd/go/internal/modfetch/proxy.go49
-rw-r--r--libgo/go/cmd/go/internal/modfetch/pseudo.go5
-rw-r--r--libgo/go/cmd/go/internal/modfetch/repo.go50
-rw-r--r--libgo/go/cmd/go/internal/modfetch/sumdb.go14
-rw-r--r--libgo/go/cmd/go/internal/modfetch/unzip.go173
-rw-r--r--libgo/go/cmd/go/internal/modfetch/zip_sum_test/testdata/zip_sums.csv2124
-rw-r--r--libgo/go/cmd/go/internal/modfetch/zip_sum_test/zip_sum_test.go230
-rw-r--r--libgo/go/cmd/go/internal/modfile/gopkgin.go47
-rw-r--r--libgo/go/cmd/go/internal/modfile/print.go164
-rw-r--r--libgo/go/cmd/go/internal/modfile/read.go869
-rw-r--r--libgo/go/cmd/go/internal/modfile/read_test.go365
-rw-r--r--libgo/go/cmd/go/internal/modfile/rule.go763
-rw-r--r--libgo/go/cmd/go/internal/modfile/rule_test.go90
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/block.golden29
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/block.in29
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/comment.golden10
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/comment.in8
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/empty.golden0
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/empty.in0
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/gopkg.in.golden6
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/module.golden1
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/module.in1
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/replace.golden5
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/replace.in5
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/replace2.golden10
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/replace2.in10
-rw-r--r--libgo/go/cmd/go/internal/modfile/testdata/rule1.golden7
-rw-r--r--libgo/go/cmd/go/internal/modget/get.go85
-rw-r--r--libgo/go/cmd/go/internal/modload/build.go112
-rw-r--r--libgo/go/cmd/go/internal/modload/help.go3
-rw-r--r--libgo/go/cmd/go/internal/modload/import.go134
-rw-r--r--libgo/go/cmd/go/internal/modload/import_test.go6
-rw-r--r--libgo/go/cmd/go/internal/modload/init.go617
-rw-r--r--libgo/go/cmd/go/internal/modload/list.go25
-rw-r--r--libgo/go/cmd/go/internal/modload/load.go229
-rw-r--r--libgo/go/cmd/go/internal/modload/query.go181
-rw-r--r--libgo/go/cmd/go/internal/modload/query_test.go3
-rw-r--r--libgo/go/cmd/go/internal/modload/search.go25
-rw-r--r--libgo/go/cmd/go/internal/modload/stat_openfile.go27
-rw-r--r--libgo/go/cmd/go/internal/modload/stat_unix.go31
-rw-r--r--libgo/go/cmd/go/internal/modload/stat_windows.go23
-rw-r--r--libgo/go/cmd/go/internal/modload/testgo.go2
-rw-r--r--libgo/go/cmd/go/internal/module/module.go632
-rw-r--r--libgo/go/cmd/go/internal/module/module_test.go319
-rw-r--r--libgo/go/cmd/go/internal/mvs/mvs.go16
-rw-r--r--libgo/go/cmd/go/internal/mvs/mvs_test.go32
-rw-r--r--libgo/go/cmd/go/internal/note/example_test.go128
-rw-r--r--libgo/go/cmd/go/internal/note/note.go683
-rw-r--r--libgo/go/cmd/go/internal/note/note_test.go472
-rw-r--r--libgo/go/cmd/go/internal/renameio/renameio_test.go14
-rw-r--r--libgo/go/cmd/go/internal/renameio/umask_test.go4
-rw-r--r--libgo/go/cmd/go/internal/robustio/robustio_darwin.go21
-rw-r--r--libgo/go/cmd/go/internal/robustio/robustio_flaky.go92
-rw-r--r--libgo/go/cmd/go/internal/robustio/robustio_other.go2
-rw-r--r--libgo/go/cmd/go/internal/robustio/robustio_windows.go80
-rw-r--r--libgo/go/cmd/go/internal/run/run.go4
-rw-r--r--libgo/go/cmd/go/internal/search/search.go84
-rw-r--r--libgo/go/cmd/go/internal/search/search_test.go2
-rw-r--r--libgo/go/cmd/go/internal/semver/semver.go388
-rw-r--r--libgo/go/cmd/go/internal/semver/semver_test.go183
-rw-r--r--libgo/go/cmd/go/internal/sumweb/cache.go59
-rw-r--r--libgo/go/cmd/go/internal/sumweb/client.go619
-rw-r--r--libgo/go/cmd/go/internal/sumweb/client_test.go460
-rw-r--r--libgo/go/cmd/go/internal/sumweb/encode.go167
-rw-r--r--libgo/go/cmd/go/internal/sumweb/encode_test.go67
-rw-r--r--libgo/go/cmd/go/internal/sumweb/server.go183
-rw-r--r--libgo/go/cmd/go/internal/sumweb/test.go133
-rw-r--r--libgo/go/cmd/go/internal/test/test.go5
-rw-r--r--libgo/go/cmd/go/internal/test/testflag.go8
-rw-r--r--libgo/go/cmd/go/internal/tlog/ct_test.go96
-rw-r--r--libgo/go/cmd/go/internal/tlog/note.go135
-rw-r--r--libgo/go/cmd/go/internal/tlog/note_test.go117
-rw-r--r--libgo/go/cmd/go/internal/tlog/tile.go418
-rw-r--r--libgo/go/cmd/go/internal/tlog/tlog.go601
-rw-r--r--libgo/go/cmd/go/internal/tlog/tlog_test.go269
-rw-r--r--libgo/go/cmd/go/internal/vet/vet.go1
-rw-r--r--libgo/go/cmd/go/internal/vet/vetflag.go8
-rw-r--r--libgo/go/cmd/go/internal/web/api.go125
-rw-r--r--libgo/go/cmd/go/internal/web/file_test.go2
-rw-r--r--libgo/go/cmd/go/internal/web/http.go29
-rw-r--r--libgo/go/cmd/go/internal/web/url_other.go2
-rw-r--r--libgo/go/cmd/go/internal/web/url_other_test.go2
-rw-r--r--libgo/go/cmd/go/internal/work/action.go14
-rw-r--r--libgo/go/cmd/go/internal/work/build.go57
-rw-r--r--libgo/go/cmd/go/internal/work/build_test.go2
-rw-r--r--libgo/go/cmd/go/internal/work/buildid.go3
-rw-r--r--libgo/go/cmd/go/internal/work/exec.go121
-rw-r--r--libgo/go/cmd/go/internal/work/gc.go3
-rw-r--r--libgo/go/cmd/go/internal/work/gccgo.go11
-rw-r--r--libgo/go/cmd/go/internal/work/init.go113
-rw-r--r--libgo/go/cmd/go/internal/work/security.go12
-rw-r--r--libgo/go/cmd/go/internal/work/security_test.go9
-rw-r--r--libgo/go/cmd/go/main.go2
-rw-r--r--libgo/go/cmd/go/proxy_test.go42
-rw-r--r--libgo/go/cmd/go/script_test.go86
-rw-r--r--libgo/go/cmd/go/testdata/dep_test.go7
-rw-r--r--libgo/go/cmd/go/testdata/local/easy.go7
-rw-r--r--libgo/go/cmd/go/testdata/local/easysub/easysub.go7
-rw-r--r--libgo/go/cmd/go/testdata/local/easysub/main.go9
-rw-r--r--libgo/go/cmd/go/testdata/local/hard.go7
-rw-r--r--libgo/go/cmd/go/testdata/local/sub/sub.go12
-rw-r--r--libgo/go/cmd/go/testdata/local/sub/sub/subsub.go7
-rw-r--r--libgo/go/cmd/go/testdata/mod/example.com_dotgo.go_v1.0.0.txt16
-rw-r--r--libgo/go/cmd/go/testdata/mod/example.com_stack_v1.0.0.txt18
-rw-r--r--libgo/go/cmd/go/testdata/mod/example.com_stack_v1.0.1.txt18
-rw-r--r--libgo/go/cmd/go/testdata/mod/not-rsc.io_quote_v0.1.0-nomod.txt59
-rw-r--r--libgo/go/cmd/go/testdata/print_goroot.go7
-rw-r--r--libgo/go/cmd/go/testdata/script/README14
-rw-r--r--libgo/go/cmd/go/testdata/script/bug.txt5
-rw-r--r--libgo/go/cmd/go/testdata/script/build_cache_trimpath.txt27
-rw-r--r--libgo/go/cmd/go/testdata/script/build_gcflags.txt21
-rw-r--r--libgo/go/cmd/go/testdata/script/build_i.txt41
-rw-r--r--libgo/go/cmd/go/testdata/script/build_multi_main.txt10
-rw-r--r--libgo/go/cmd/go/testdata/script/build_trimpath.txt137
-rw-r--r--libgo/go/cmd/go/testdata/script/cache_vet.txt22
-rw-r--r--libgo/go/cmd/go/testdata/script/cmd_import_error.txt2
-rw-r--r--libgo/go/cmd/go/testdata/script/cover_mod_empty.txt11
-rw-r--r--libgo/go/cmd/go/testdata/script/cover_modes.txt25
-rw-r--r--libgo/go/cmd/go/testdata/script/cover_pkgall_multiple_mains.txt21
-rw-r--r--libgo/go/cmd/go/testdata/script/devnull.txt26
-rw-r--r--libgo/go/cmd/go/testdata/script/env_write.txt33
-rw-r--r--libgo/go/cmd/go/testdata/script/fmt_load_errors.txt19
-rw-r--r--libgo/go/cmd/go/testdata/script/gccgo_m.txt19
-rw-r--r--libgo/go/cmd/go/testdata/script/gccgo_mangle.txt15
-rw-r--r--libgo/go/cmd/go/testdata/script/get_insecure_redirect.txt5
-rw-r--r--libgo/go/cmd/go/testdata/script/goflags.txt8
-rw-r--r--libgo/go/cmd/go/testdata/script/gopath_install.txt53
-rw-r--r--libgo/go/cmd/go/testdata/script/gopath_local.txt117
-rw-r--r--libgo/go/cmd/go/testdata/script/gopath_moved_repo.txt68
-rw-r--r--libgo/go/cmd/go/testdata/script/gopath_paths.txt43
-rw-r--r--libgo/go/cmd/go/testdata/script/import_main.txt114
-rw-r--r--libgo/go/cmd/go/testdata/script/install_cmd_gobin.txt2
-rw-r--r--libgo/go/cmd/go/testdata/script/install_cross_gobin.txt3
-rw-r--r--libgo/go/cmd/go/testdata/script/link_syso_issue33139.txt43
-rw-r--r--libgo/go/cmd/go/testdata/script/list_ambiguous_path.txt38
-rw-r--r--libgo/go/cmd/go/testdata/script/list_constraints.txt86
-rw-r--r--libgo/go/cmd/go/testdata/script/list_linkshared.txt16
-rw-r--r--libgo/go/cmd/go/testdata/script/list_parse_err.txt17
-rw-r--r--libgo/go/cmd/go/testdata/script/list_split_main.txt25
-rw-r--r--libgo/go/cmd/go/testdata/script/list_tags.txt10
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_ambiguous_import.txt49
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_auth.txt2
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_bad_domain.txt8
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_build_info_err.txt22
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_cache_rw.txt49
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_convert_tsv_insecure.txt27
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_convert_vendor_json.txt2
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_convert_vendor_manifest.txt2
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_doc.txt29
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_download.txt17
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_download_json.txt10
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_download_latest.txt20
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_download_replace_file.txt16
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_edit.txt14
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_edit_go.txt2
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_empty_err.txt36
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_fs_patterns.txt35
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_get_direct.txt20
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_get_insecure_redirect.txt34
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_get_major.txt23
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_get_newcycle.txt1
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_get_patterns.txt4
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_get_svn.txt31
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_get_trailing_slash.txt30
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_getmode_vendor.txt15
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_getx.txt14
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_go_version_mixed.txt43
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_goroot_errors.txt55
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_in_testdata_dir.txt45
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_internal.txt12
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_issue35317.txt8
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_list_dir.txt4
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_list_e_readonly.txt15
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_list_upgrade.txt20
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_load_badchain.txt4
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_missing_repo.txt15
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_missingpkg_prerelease.txt5
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_modinfo.txt3
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_outside.txt167
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_permissions.txt57
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_prefer_compatible.txt65
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_proxy_errors.txt19
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_readonly.txt59
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_replace.txt14
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_replace_gopkgin.txt28
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_replace_import.txt20
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_retention.txt135
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_sumdb.txt2
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_sumdb_cache.txt7
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_sumdb_file_path.txt5
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_test_files.txt1
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_tidy.txt1
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_tidy_cycle.txt75
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_tidy_error.txt4
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_tidy_replace.txt26
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_vendor.txt56
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_vendor_auto.txt256
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_vendor_build.txt2
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_vendor_replace.txt31
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_vendor_unused.txt67
-rw-r--r--libgo/go/cmd/go/testdata/script/modfile_flag.txt84
-rw-r--r--libgo/go/cmd/go/testdata/script/noncanonical_import.txt21
-rw-r--r--libgo/go/cmd/go/testdata/script/test_bad_example.txt13
-rw-r--r--libgo/go/cmd/go/testdata/script/test_cache_inputs.txt230
-rw-r--r--libgo/go/cmd/go/testdata/script/test_compile_binary.txt2
-rw-r--r--libgo/go/cmd/go/testdata/script/test_compile_tempfile.txt11
-rw-r--r--libgo/go/cmd/go/testdata/script/test_devnull.txt15
-rw-r--r--libgo/go/cmd/go/testdata/script/test_main_archive.txt32
-rw-r--r--libgo/go/cmd/go/testdata/script/test_rebuildall.txt14
-rw-r--r--libgo/go/cmd/go/testdata/script/test_timeout.txt11
-rw-r--r--libgo/go/cmd/go/testdata/script/version.txt5
-rw-r--r--libgo/go/cmd/go/testdata/script/vet_flags.txt37
-rw-r--r--libgo/go/cmd/go/testdata/src/canonical/a/a.go3
-rw-r--r--libgo/go/cmd/go/testdata/src/canonical/a/vendor/c/c.go1
-rw-r--r--libgo/go/cmd/go/testdata/src/canonical/b/b.go3
-rw-r--r--libgo/go/cmd/go/testdata/src/canonical/d/d.go3
-rw-r--r--libgo/go/cmd/go/testdata/src/go-cmd-test/helloworld.go5
-rw-r--r--libgo/go/cmd/go/testdata/src/main_test/m.go4
-rw-r--r--libgo/go/cmd/go/testdata/src/main_test/m_test.go10
-rw-r--r--libgo/go/cmd/go/testdata/src/testcache/testcache_test.go91
-rw-r--r--libgo/go/cmd/gofmt/gofmt.go46
-rw-r--r--libgo/go/cmd/gofmt/gofmt_test.go4
-rw-r--r--libgo/go/cmd/gofmt/rewrite.go6
-rw-r--r--libgo/go/cmd/gofmt/testdata/import.golden73
-rw-r--r--libgo/go/cmd/gofmt/testdata/import.input71
-rw-r--r--libgo/go/cmd/gofmt/testdata/issue28082.golden13
-rw-r--r--libgo/go/cmd/gofmt/testdata/issue28082.input13
-rw-r--r--libgo/go/cmd/gofmt/testdata/rewrite10.golden19
-rw-r--r--libgo/go/cmd/gofmt/testdata/rewrite10.input19
-rw-r--r--libgo/go/cmd/internal/buildid/buildid_test.go41
-rw-r--r--libgo/go/cmd/internal/buildid/testdata/a.elfbin12768 -> 0 bytes
-rw-r--r--libgo/go/cmd/internal/buildid/testdata/a.elf.base641
-rw-r--r--libgo/go/cmd/internal/buildid/testdata/a.machobin13472 -> 0 bytes
-rw-r--r--libgo/go/cmd/internal/buildid/testdata/a.macho.base641
-rw-r--r--libgo/go/cmd/internal/buildid/testdata/a.pebin3584 -> 0 bytes
-rw-r--r--libgo/go/cmd/internal/buildid/testdata/a.pe.base641
-rw-r--r--libgo/go/cmd/internal/buildid/testdata/p.abin682 -> 0 bytes
-rw-r--r--libgo/go/cmd/internal/buildid/testdata/p.a.base641
-rw-r--r--libgo/go/cmd/internal/diff/diff.go58
-rw-r--r--libgo/go/cmd/internal/objabi/doc.go6
-rw-r--r--libgo/go/cmd/internal/objabi/funcdata.go11
-rw-r--r--libgo/go/cmd/internal/objabi/funcid.go15
-rw-r--r--libgo/go/cmd/internal/objabi/head.go5
-rw-r--r--libgo/go/cmd/internal/objabi/reloctype.go43
-rw-r--r--libgo/go/cmd/internal/objabi/reloctype_string.go4
-rw-r--r--libgo/go/cmd/internal/objabi/stack.go2
-rw-r--r--libgo/go/cmd/internal/objabi/symkind.go4
-rw-r--r--libgo/go/cmd/internal/objabi/util.go2
-rw-r--r--libgo/go/cmd/internal/sys/arch.go24
-rw-r--r--libgo/go/cmd/internal/sys/supported.go68
-rw-r--r--libgo/go/cmd/vet/testdata/asm/asm.go2
-rw-r--r--libgo/go/cmd/vet/testdata/asm/asm1.s23
-rw-r--r--libgo/go/cmd/vet/testdata/print/print.go5
-rw-r--r--libgo/go/cmd/vet/testdata/src/asm/asm1.s8
318 files changed, 9890 insertions, 11909 deletions
diff --git a/libgo/go/cmd/cgo/doc.go b/libgo/go/cmd/cgo/doc.go
index f227d7f8502..8c3bf81bf78 100644
--- a/libgo/go/cmd/cgo/doc.go
+++ b/libgo/go/cmd/cgo/doc.go
@@ -55,7 +55,7 @@ For example:
The default pkg-config tool may be changed by setting the PKG_CONFIG environment variable.
-For security reasons, only a limited set of flags are allowed, notably -D, -I, and -l.
+For security reasons, only a limited set of flags are allowed, notably -D, -U, -I, and -l.
To allow additional flags, set CGO_CFLAGS_ALLOW to a regular expression
matching the new flags. To disallow flags that would otherwise be allowed,
set CGO_CFLAGS_DISALLOW to a regular expression matching arguments
@@ -99,7 +99,7 @@ Will be expanded to:
When the Go tool sees that one or more Go files use the special import
"C", it will look for other non-Go files in the directory and compile
-them as part of the Go package. Any .c, .s, or .S files will be
+them as part of the Go package. Any .c, .s, .S or .sx files will be
compiled with the C compiler. Any .cc, .cpp, or .cxx files will be
compiled with the C++ compiler. Any .f, .F, .for or .f90 files will be
compiled with the fortran compiler. Any .h, .hh, .hpp, or .hxx files will
diff --git a/libgo/go/cmd/cgo/gcc.go b/libgo/go/cmd/cgo/gcc.go
index 526d4c2bddf..678b348c89b 100644
--- a/libgo/go/cmd/cgo/gcc.go
+++ b/libgo/go/cmd/cgo/gcc.go
@@ -834,7 +834,7 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) {
// Rewrite C.f(p) to
// func() {
// _cgo0 := p
- // _cgoCheckPointer(_cgo0)
+ // _cgoCheckPointer(_cgo0, nil)
// C.f(_cgo0)
// }()
// Using a function literal like this lets us evaluate the
@@ -852,7 +852,7 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) {
// defer func() func() {
// _cgo0 := p
// return func() {
- // _cgoCheckPointer(_cgo0)
+ // _cgoCheckPointer(_cgo0, nil)
// C.f(_cgo0)
// }
// }()()
@@ -939,7 +939,7 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) {
}
fmt.Fprintf(&sb, "_cgo%d := %s; ", i, gofmtPos(arg, origArg.Pos()))
- fmt.Fprintf(&sbCheck, "_cgoCheckPointer(_cgo%d); ", i)
+ fmt.Fprintf(&sbCheck, "_cgoCheckPointer(_cgo%d, nil); ", i)
}
if call.Deferred {
@@ -2211,6 +2211,11 @@ func (c *typeConv) FinishType(pos token.Pos) {
// Type returns a *Type with the same memory layout as
// dtype when used as the type of a variable or a struct field.
func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type {
+ return c.loadType(dtype, pos, "")
+}
+
+// loadType recursively loads the requested dtype and its dependency graph.
+func (c *typeConv) loadType(dtype dwarf.Type, pos token.Pos, parent string) *Type {
// Always recompute bad pointer typedefs, as the set of such
// typedefs changes as we see more types.
checkCache := true
@@ -2218,7 +2223,9 @@ func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type {
checkCache = false
}
- key := dtype.String()
+ // The cache key should be relative to its parent.
+ // See issue https://golang.org/issue/31891
+ key := parent + " > " + dtype.String()
if checkCache {
if t, ok := c.m[key]; ok {
@@ -2258,7 +2265,7 @@ func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type {
// Translate to zero-length array instead.
count = 0
}
- sub := c.Type(dt.Type, pos)
+ sub := c.loadType(dt.Type, pos, key)
t.Align = sub.Align
t.Go = &ast.ArrayType{
Len: c.intExpr(count),
@@ -2403,7 +2410,7 @@ func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type {
c.ptrs[key] = append(c.ptrs[key], t)
case *dwarf.QualType:
- t1 := c.Type(dt.Type, pos)
+ t1 := c.loadType(dt.Type, pos, key)
t.Size = t1.Size
t.Align = t1.Align
t.Go = t1.Go
@@ -2487,7 +2494,7 @@ func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type {
}
name := c.Ident("_Ctype_" + dt.Name)
goIdent[name.Name] = name
- sub := c.Type(dt.Type, pos)
+ sub := c.loadType(dt.Type, pos, key)
if c.badPointerTypedef(dt) {
// Treat this typedef as a uintptr.
s := *sub
diff --git a/libgo/go/cmd/cgo/out.go b/libgo/go/cmd/cgo/out.go
index 97886e1abd0..4d66e1b24b3 100644
--- a/libgo/go/cmd/cgo/out.go
+++ b/libgo/go/cmd/cgo/out.go
@@ -1638,14 +1638,14 @@ func _cgo_runtime_cgocall(unsafe.Pointer, uintptr) int32
func _cgo_runtime_cgocallback(unsafe.Pointer, unsafe.Pointer, uintptr, uintptr)
//go:linkname _cgoCheckPointer runtime.cgoCheckPointer
-func _cgoCheckPointer(interface{}, ...interface{})
+func _cgoCheckPointer(interface{}, interface{})
//go:linkname _cgoCheckResult runtime.cgoCheckResult
func _cgoCheckResult(interface{})
`
const gccgoGoProlog = `
-func _cgoCheckPointer(interface{}, ...interface{})
+func _cgoCheckPointer(interface{}, interface{})
func _cgoCheckResult(interface{})
`
@@ -1832,16 +1832,16 @@ typedef struct __go_empty_interface {
void *__object;
} Eface;
-extern void runtimeCgoCheckPointer(Eface, Slice)
+extern void runtimeCgoCheckPointer(Eface, Eface)
__asm__("runtime.cgoCheckPointer")
__attribute__((weak));
-extern void localCgoCheckPointer(Eface, Slice)
+extern void localCgoCheckPointer(Eface, Eface)
__asm__("GCCGOSYMBOLPREF._cgoCheckPointer");
-void localCgoCheckPointer(Eface ptr, Slice args) {
+void localCgoCheckPointer(Eface ptr, Eface arg) {
if(runtimeCgoCheckPointer) {
- runtimeCgoCheckPointer(ptr, args);
+ runtimeCgoCheckPointer(ptr, arg);
}
}
diff --git a/libgo/go/cmd/go/alldocs.go b/libgo/go/cmd/go/alldocs.go
index ebbead5d316..54e7a8b5b30 100644
--- a/libgo/go/cmd/go/alldocs.go
+++ b/libgo/go/cmd/go/alldocs.go
@@ -110,11 +110,13 @@
// The default is the number of CPUs available.
// -race
// enable data race detection.
-// Supported only on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64.
+// Supported only on linux/amd64, freebsd/amd64, darwin/amd64, windows/amd64,
+// linux/ppc64le and linux/arm64 (only for 48-bit VMA).
// -msan
// enable interoperation with memory sanitizer.
// Supported only on linux/amd64, linux/arm64
// and only with Clang/LLVM as the host C compiler.
+// On linux/arm64, pie build mode will be used.
// -v
// print the names of packages as they are compiled.
// -work
@@ -143,11 +145,21 @@
// -ldflags '[pattern=]arg list'
// arguments to pass on each go tool link invocation.
// -linkshared
-// link against shared libraries previously created with
-// -buildmode=shared.
+// build code that will be linked against shared libraries previously
+// created with -buildmode=shared.
// -mod mode
-// module download mode to use: readonly or vendor.
+// module download mode to use: readonly, vendor, or mod.
// See 'go help modules' for more.
+// -modcacherw
+// leave newly-created directories in the module cache read-write
+// instead of making them read-only.
+// -modfile file
+// in module aware mode, read (and possibly write) an alternate go.mod
+// file instead of the one in the module root directory. A file named
+// "go.mod" must still be present in order to determine the module root
+// directory, but it is not accessed. When -modfile is specified, an
+// alternate go.sum file is also used: its path is derived from the
+// -modfile flag by trimming the ".mod" extension and appending ".sum".
// -pkgdir dir
// install and load all packages from dir instead of the usual locations.
// For example, when building with a non-standard configuration,
@@ -361,6 +373,8 @@
// Treat a command (package main) like a regular package.
// Otherwise package main's exported symbols are hidden
// when showing the package's top-level documentation.
+// -short
+// One-line representation for each symbol.
// -src
// Show the full source code for the symbol. This will
// display the full Go source of its declaration and
@@ -431,6 +445,9 @@
// The -n flag prints commands that would be executed.
// The -x flag prints commands as they are executed.
//
+// The -mod flag's value sets which module download mode
+// to use: readonly or vendor. See 'go help modules' for more.
+//
// To run gofmt with specific options, run gofmt itself.
//
// See also: go fix, go vet.
@@ -993,7 +1010,7 @@
//
// Usage:
//
-// go mod download [-json] [modules]
+// go mod download [-x] [-json] [modules]
//
// Download downloads the named modules, which can be module patterns selecting
// dependencies of the main module or module queries of the form path@version.
@@ -1018,9 +1035,10 @@
// Dir string // absolute path to cached source root directory
// Sum string // checksum for path, version (as in go.sum)
// GoModSum string // checksum for go.mod (as in go.sum)
-// Latest bool // would @latest resolve to this version?
// }
//
+// The -x flag causes download to print the commands download executes.
+//
// See 'go help modules' for more about module queries.
//
//
@@ -1057,12 +1075,17 @@
// add and drop an exclusion for the given module path and version.
// Note that -exclude=path@version is a no-op if that exclusion already exists.
//
-// The -replace=old[@v]=new[@v] and -dropreplace=old[@v] flags
-// add and drop a replacement of the given module path and version pair.
-// If the @v in old@v is omitted, the replacement applies to all versions
-// with the old module path. If the @v in new@v is omitted, the new path
-// should be a local module root directory, not a module path.
-// Note that -replace overrides any existing replacements for old[@v].
+// The -replace=old[@v]=new[@v] flag adds a replacement of the given
+// module path and version pair. If the @v in old@v is omitted, a
+// replacement without a version on the left side is added, which applies
+// to all versions of the old module path. If the @v in new@v is omitted,
+// the new path should be a local module root directory, not a module
+// path. Note that -replace overrides any redundant replacements for old[@v],
+// so omitting @v will drop existing replacements for specific versions.
+//
+// The -dropreplace=old[@v] flag drops a replacement of the given
+// module path and version pair. If the @v is omitted, a replacement without
+// a version on the left side is dropped.
//
// The -require, -droprequire, -exclude, -dropexclude, -replace,
// and -dropreplace editing flags may be repeated, and the changes
@@ -1232,7 +1255,7 @@
// If the -exec flag is not given, GOOS or GOARCH is different from the system
// default, and a program named go_$GOOS_$GOARCH_exec can be found
// on the current search path, 'go run' invokes the binary using that program,
-// for example 'go_nacl_386_exec a.out arguments...'. This allows execution of
+// for example 'go_js_wasm_exec a.out arguments...'. This allows execution of
// cross-compiled programs when a simulator or other execution method is
// available.
//
@@ -1504,8 +1527,8 @@
// extension will be passed to SWIG. Any file with a .swigcxx extension
// will be passed to SWIG with the -c++ option.
//
-// When either cgo or SWIG is used, go build will pass any .c, .m, .s,
-// or .S files to the C compiler, and any .cc, .cpp, .cxx files to the C++
+// When either cgo or SWIG is used, go build will pass any .c, .m, .s, .S
+// or .sx files to the C compiler, and any .cc, .cpp, .cxx files to the C++
// compiler. The CC or CXX environment variables may be set to determine
// the C or C++ compiler, respectively, to use.
//
@@ -1588,6 +1611,10 @@
// Because the entries are space-separated, flag values must
// not contain spaces. Flags listed on the command line
// are applied after this list and therefore override it.
+// GOINSECURE
+// Comma-separated list of glob patterns (in the syntax of Go's path.Match)
+// of module path prefixes that should always be fetched in an insecure
+// manner. Only applies to dependencies that are being fetched directly.
// GOOS
// The operating system for which to compile code.
// Examples are linux, darwin, windows, netbsd.
@@ -1699,8 +1726,10 @@
// GOHOSTOS
// The operating system (GOOS) of the Go toolchain binaries.
// GOMOD
-// The absolute path to the go.mod of the main module,
-// or the empty string if not using modules.
+// The absolute path to the go.mod of the main module.
+// If module-aware mode is enabled, but there is no go.mod, GOMOD will be
+// os.DevNull ("/dev/null" on Unix-like systems, "NUL" on Windows).
+// If module-aware mode is disabled, GOMOD will be the empty string.
// GOTOOLDIR
// The directory where the go tools (compile, cover, doc, etc...) are installed.
//
@@ -1724,7 +1753,7 @@
// .m
// Objective-C source files. Only useful with cgo, and always
// compiled with the OS-native compiler.
-// .s, .S
+// .s, .S, .sx
// Assembler source files.
// If the package uses cgo or SWIG, these will be assembled with the
// OS-native assembler (typically gcc (sic)); otherwise they
@@ -2060,8 +2089,8 @@
//
// The GET requests sent to a Go module proxy are:
//
-// GET $GOPROXY/<module>/@v/list returns a list of all known versions of the
-// given module, one per line.
+// GET $GOPROXY/<module>/@v/list returns a list of known versions of the given
+// module, one per line.
//
// GET $GOPROXY/<module>/@v/<version>.info returns JSON-formatted metadata
// about that version of the given module.
@@ -2072,6 +2101,21 @@
// GET $GOPROXY/<module>/@v/<version>.zip returns the zip archive
// for that version of the given module.
//
+// GET $GOPROXY/<module>/@latest returns JSON-formatted metadata about the
+// latest known version of the given module in the same format as
+// <module>/@v/<version>.info. The latest version should be the version of
+// the module the go command may use if <module>/@v/list is empty or no
+// listed version is suitable. <module>/@latest is optional and may not
+// be implemented by a module proxy.
+//
+// When resolving the latest version of a module, the go command will request
+// <module>/@v/list, then, if no suitable versions are found, <module>/@latest.
+// The go command prefers, in order: the semantically highest release version,
+// the semantically highest pre-release version, and the chronologically
+// most recent pseudo-version. In Go 1.12 and earlier, the go command considered
+// pseudo-versions in <module>/@v/list to be pre-release versions, but this is
+// no longer true since Go 1.13.
+//
// To avoid problems when serving from case-sensitive file systems,
// the <module> and <version> elements are case-encoded, replacing every
// uppercase letter with an exclamation mark followed by the corresponding
@@ -2460,6 +2504,9 @@
// directory holds the correct copies of dependencies and ignores
// the dependency descriptions in go.mod.
//
+// If invoked with -mod=mod, the go command loads modules from the module cache
+// even if there is a vendor directory present.
+//
// Pseudo-versions
//
// The go.mod file and the go command more generally use semantic versions as
diff --git a/libgo/go/cmd/go/go_test.go b/libgo/go/cmd/go/go_test.go
index f936d703c07..ebd0c7ad0ad 100644
--- a/libgo/go/cmd/go/go_test.go
+++ b/libgo/go/cmd/go/go_test.go
@@ -56,7 +56,7 @@ func tooSlow(t *testing.T) {
func init() {
switch runtime.GOOS {
- case "android", "js", "nacl":
+ case "android", "js":
canRun = false
case "darwin":
switch runtime.GOARCH {
@@ -206,7 +206,7 @@ func TestMain(m *testing.M) {
// (installed in GOROOT/pkg/tool/GOOS_GOARCH).
// If these are not the same toolchain, then the entire standard library
// will look out of date (the compilers in those two different tool directories
- // are built for different architectures and have different buid IDs),
+ // are built for different architectures and have different build IDs),
// which will cause many tests to do unnecessary rebuilds and some
// tests to attempt to overwrite the installed standard library.
// Bail out entirely in this case.
@@ -683,8 +683,11 @@ func (tg *testgoData) creatingTemp(path string) {
// If we have changed the working directory, make sure we have
// an absolute path, because we are going to change directory
// back before we remove the temporary.
- if tg.wd != "" && !filepath.IsAbs(path) {
- path = filepath.Join(tg.pwd(), path)
+ if !filepath.IsAbs(path) {
+ if tg.wd == "" || strings.HasPrefix(tg.wd, testGOROOT) {
+ tg.t.Fatalf("internal testsuite error: creatingTemp(%q) within GOROOT/src", path)
+ }
+ path = filepath.Join(tg.wd, path)
}
tg.must(robustio.RemoveAll(path))
tg.temps = append(tg.temps, path)
@@ -917,6 +920,7 @@ func TestNewReleaseRebuildsStalePackagesInGOPATH(t *testing.T) {
"src/runtime",
"src/internal/bytealg",
"src/internal/cpu",
+ "src/math/bits",
"src/unsafe",
filepath.Join("pkg", runtime.GOOS+"_"+runtime.GOARCH),
filepath.Join("pkg/tool", runtime.GOOS+"_"+runtime.GOARCH),
@@ -942,7 +946,7 @@ func TestNewReleaseRebuildsStalePackagesInGOPATH(t *testing.T) {
return err
}
tg.tempFile(dest, string(data))
- if err := os.Chmod(tg.path(dest), info.Mode()); err != nil {
+ if err := os.Chmod(tg.path(dest), info.Mode()|0200); err != nil {
return err
}
return nil
@@ -1007,128 +1011,6 @@ func TestNewReleaseRebuildsStalePackagesInGOPATH(t *testing.T) {
tg.wantNotStale("p1", "", "./testgo list claims p1 is stale after building with old release")
}
-func testLocalRun(tg *testgoData, exepath, local, match string) {
- tg.t.Helper()
- out, err := exec.Command(exepath).Output()
- if err != nil {
- tg.t.Fatalf("error running %v: %v", exepath, err)
- }
- if !regexp.MustCompile(match).Match(out) {
- tg.t.Log(string(out))
- tg.t.Errorf("testdata/%s/easy.go did not generate expected output", local)
- }
-}
-
-func testLocalEasy(tg *testgoData, local string) {
- tg.t.Helper()
- exepath := "./easy" + exeSuffix
- tg.creatingTemp(exepath)
- tg.run("build", "-o", exepath, filepath.Join("testdata", local, "easy.go"))
- testLocalRun(tg, exepath, local, `(?m)^easysub\.Hello`)
-}
-
-func testLocalEasySub(tg *testgoData, local string) {
- tg.t.Helper()
- exepath := "./easysub" + exeSuffix
- tg.creatingTemp(exepath)
- tg.run("build", "-o", exepath, filepath.Join("testdata", local, "easysub", "main.go"))
- testLocalRun(tg, exepath, local, `(?m)^easysub\.Hello`)
-}
-
-func testLocalHard(tg *testgoData, local string) {
- tg.t.Helper()
- exepath := "./hard" + exeSuffix
- tg.creatingTemp(exepath)
- tg.run("build", "-o", exepath, filepath.Join("testdata", local, "hard.go"))
- testLocalRun(tg, exepath, local, `(?m)^sub\.Hello`)
-}
-
-func testLocalInstall(tg *testgoData, local string) {
- tg.t.Helper()
- tg.runFail("install", filepath.Join("testdata", local, "easy.go"))
-}
-
-func TestLocalImportsEasy(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- testLocalEasy(tg, "local")
-}
-
-func TestLocalImportsEasySub(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- testLocalEasySub(tg, "local")
-}
-
-func TestLocalImportsHard(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- testLocalHard(tg, "local")
-}
-
-func TestLocalImportsGoInstallShouldFail(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- testLocalInstall(tg, "local")
-}
-
-const badDirName = `#$%:, &()*;<=>?\^{}`
-
-func copyBad(tg *testgoData) {
- tg.t.Helper()
- if runtime.GOOS == "windows" {
- tg.t.Skipf("skipping test because %q is an invalid directory name", badDirName)
- }
-
- tg.must(filepath.Walk("testdata/local",
- func(path string, info os.FileInfo, err error) error {
- if err != nil {
- return err
- }
- if info.IsDir() {
- return nil
- }
- var data []byte
- data, err = ioutil.ReadFile(path)
- if err != nil {
- return err
- }
- newpath := strings.Replace(path, "local", badDirName, 1)
- tg.tempFile(newpath, string(data))
- return nil
- }))
- tg.cd(tg.path("."))
-}
-
-func TestBadImportsEasy(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- // TODO: tg.parallel()
- copyBad(tg)
- testLocalEasy(tg, badDirName)
-}
-
-func TestBadImportsEasySub(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- copyBad(tg)
- testLocalEasySub(tg, badDirName)
-}
-
-func TestBadImportsHard(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- copyBad(tg)
- testLocalHard(tg, badDirName)
-}
-
-func TestBadImportsGoInstallShouldFail(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- copyBad(tg)
- testLocalInstall(tg, badDirName)
-}
-
func TestInternalPackagesInGOROOTAreRespected(t *testing.T) {
skipIfGccgo(t, "gccgo does not have GOROOT")
tg := testgo(t)
@@ -1166,48 +1048,6 @@ func TestRunPkg(t *testing.T) {
tg.grepStderr("hello, world", "did not find hello, world")
}
-func testMove(t *testing.T, vcs, url, base, config string) {
- testenv.MustHaveExternalNetwork(t)
-
- tg := testgo(t)
- defer tg.cleanup()
- tg.parallel()
- tg.tempDir("src")
- tg.must(os.Mkdir(tg.path(".hg"), 0700))
- tg.must(ioutil.WriteFile(filepath.Join(tg.path(".hg"), "hgrc"), nil, 0600))
- tg.setenv("GOPATH", tg.path("."))
- tg.run("get", "-d", url)
- tg.run("get", "-d", "-u", url)
- switch vcs {
- case "svn":
- // SVN doesn't believe in text files so we can't just edit the config.
- // Check out a different repo into the wrong place.
- tg.must(robustio.RemoveAll(tg.path("src/code.google.com/p/rsc-svn")))
- tg.run("get", "-d", "-u", "code.google.com/p/rsc-svn2/trunk")
- tg.must(os.Rename(tg.path("src/code.google.com/p/rsc-svn2"), tg.path("src/code.google.com/p/rsc-svn")))
- default:
- path := tg.path(filepath.Join("src", config))
- data, err := ioutil.ReadFile(path)
- tg.must(err)
- data = bytes.ReplaceAll(data, []byte(base), []byte(base+"XXX"))
- tg.must(ioutil.WriteFile(path, data, 0644))
- }
- if vcs == "git" {
- // git will ask for a username and password when we
- // run go get -d -f -u. An empty username and
- // password will work. Prevent asking by setting
- // GIT_ASKPASS.
- tg.creatingTemp("sink" + exeSuffix)
- tg.tempFile("src/sink/sink.go", `package main; func main() {}`)
- tg.run("build", "-o", "sink"+exeSuffix, "sink")
- tg.setenv("GIT_ASKPASS", filepath.Join(tg.pwd(), "sink"+exeSuffix))
- }
- tg.runFail("get", "-d", "-u", url)
- tg.grepStderr("is a custom import path for", "go get -d -u "+url+" failed for wrong reason")
- tg.runFail("get", "-d", "-f", "-u", url)
- tg.grepStderr("validating server certificate|[nN]ot [fF]ound", "go get -d -f -u "+url+" failed for wrong reason")
-}
-
func TestInternalPackageErrorsAreHandled(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()
@@ -1222,21 +1062,6 @@ func TestInternalCache(t *testing.T) {
tg.grepStderr("internal", "did not fail to build p")
}
-func TestMoveGit(t *testing.T) {
- testenv.MustHaveExecPath(t, "git")
- testMove(t, "git", "rsc.io/pdf", "pdf", "rsc.io/pdf/.git/config")
-}
-
-func TestMoveHG(t *testing.T) {
- testenv.MustHaveExecPath(t, "hg")
- testMove(t, "hg", "vcs-test.golang.org/go/custom-hg-hello", "custom-hg-hello", "vcs-test.golang.org/go/custom-hg-hello/.hg/hgrc")
-}
-
-// TODO(rsc): Set up a test case on SourceForge (?) for svn.
-// func testMoveSVN(t *testing.T) {
-// testMove(t, "svn", "code.google.com/p/rsc-svn/trunk", "-", "-")
-// }
-
func TestImportCommandMatch(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()
@@ -1435,17 +1260,6 @@ func TestRelativeImportsInCommandLinePackage(t *testing.T) {
tg.run(append([]string{"test"}, files...)...)
}
-func TestNonCanonicalImportPaths(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- tg.parallel()
- tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
- tg.runFail("build", "canonical/d")
- tg.grepStderr("package canonical/d", "did not report canonical/d")
- tg.grepStderr("imports canonical/b", "did not report canonical/b")
- tg.grepStderr("imports canonical/a/: non-canonical", "did not report canonical/a/")
-}
-
func TestVersionControlErrorMessageIncludesCorrectDirectory(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()
@@ -1502,72 +1316,6 @@ func TestRelativeGOBINFail(t *testing.T) {
tg.grepStderr("cannot install, GOBIN must be an absolute path", "go install must fail if $GOBIN is a relative path")
}
-// Test that without $GOBIN set, binaries get installed
-// into the GOPATH bin directory.
-func TestInstallIntoGOPATH(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- tg.creatingTemp("testdata/bin/go-cmd-test" + exeSuffix)
- tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
- tg.run("install", "go-cmd-test")
- tg.wantExecutable("testdata/bin/go-cmd-test"+exeSuffix, "go install go-cmd-test did not write to testdata/bin/go-cmd-test")
-}
-
-// Issue 12407
-func TestBuildOutputToDevNull(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- fi1, err1 := os.Lstat(os.DevNull)
- tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
- tg.run("build", "-o", os.DevNull, "go-cmd-test")
- fi2, err2 := os.Lstat(os.DevNull)
- if err1 == nil {
- if err2 != nil {
- t.Errorf("second stat of /dev/null failed: %v", err2)
- } else if !os.SameFile(fi1, fi2) {
- t.Errorf("/dev/null changed: now %v was %v", fi1, fi2)
- }
- }
-}
-
-// Issue 28549.
-func TestTestOutputToDevNull(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- fi1, err1 := os.Lstat(os.DevNull)
- tg.makeTempdir()
- tg.setenv("GOPATH", tg.path("."))
- tg.tempFile("src/p/p.go", "package p\n")
- tg.tempFile("src/p/p_test.go", "package p\nimport \"testing\"\nfunc TestX(t *testing.T) {}\n")
- tg.run("test", "-o", os.DevNull, "-c", "p")
- tg.mustNotExist("p.test")
- fi2, err2 := os.Lstat(os.DevNull)
- if err1 == nil {
- if err2 != nil {
- t.Errorf("second stat of /dev/null failed: %v", err2)
- } else if !os.SameFile(fi1, fi2) {
- t.Errorf("/dev/null changed: now %v was %v", fi1, fi2)
- }
- }
-}
-
-func TestPackageMainTestImportsArchiveNotBinary(t *testing.T) {
- tooSlow(t)
- tg := testgo(t)
- defer tg.cleanup()
- tg.parallel()
- gobin := filepath.Join(tg.pwd(), "testdata", "bin")
- tg.creatingTemp(gobin)
- tg.setenv("GOBIN", gobin)
- tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
- tg.must(os.Chtimes("./testdata/src/main_test/m.go", time.Now(), time.Now()))
- tg.sleep()
- tg.run("test", "main_test")
- tg.run("install", "main_test")
- tg.wantNotStale("main_test", "", "after go install, main listed as stale")
- tg.run("test", "main_test")
-}
-
func TestPackageMainTestCompilerFlags(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()
@@ -1600,51 +1348,6 @@ func TestPackageNotStaleWithTrailingSlash(t *testing.T) {
tg.wantNotStale("io", "", "with trailing slash in GOROOT, io listed as stale")
}
-// With $GOBIN set, binaries get installed to $GOBIN.
-func TestInstallIntoGOBIN(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- gobin := filepath.Join(tg.pwd(), "testdata", "bin1")
- tg.creatingTemp(gobin)
- tg.setenv("GOBIN", gobin)
- tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
- tg.run("install", "go-cmd-test")
- tg.wantExecutable("testdata/bin1/go-cmd-test"+exeSuffix, "go install go-cmd-test did not write to testdata/bin1/go-cmd-test")
-}
-
-// Issue 11065
-func TestInstallToCurrentDirectoryCreatesExecutable(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- pkg := filepath.Join(tg.pwd(), "testdata", "src", "go-cmd-test")
- tg.creatingTemp(filepath.Join(pkg, "go-cmd-test"+exeSuffix))
- tg.setenv("GOBIN", pkg)
- tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
- tg.cd(pkg)
- tg.run("install")
- tg.wantExecutable("go-cmd-test"+exeSuffix, "go install did not write to current directory")
-}
-
-// Without $GOBIN set, installing a program outside $GOPATH should fail
-// (there is nowhere to install it).
-func TestInstallWithoutDestinationFails(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- tg.runFail("install", "testdata/src/go-cmd-test/helloworld.go")
- tg.grepStderr("no install location for .go files listed on command line", "wrong error")
-}
-
-// With $GOBIN set, should install there.
-func TestInstallToGOBINCommandLinePackage(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- gobin := filepath.Join(tg.pwd(), "testdata", "bin1")
- tg.creatingTemp(gobin)
- tg.setenv("GOBIN", gobin)
- tg.run("install", "testdata/src/go-cmd-test/helloworld.go")
- tg.wantExecutable("testdata/bin1/helloworld"+exeSuffix, "go install testdata/src/go-cmd-test/helloworld.go did not write testdata/bin1/helloworld")
-}
-
func TestGoGetNonPkg(t *testing.T) {
testenv.MustHaveExternalNetwork(t)
testenv.MustHaveExecPath(t, "git")
@@ -1674,94 +1377,6 @@ func TestGoGetTestOnlyPkg(t *testing.T) {
tg.run("get", "-t", "golang.org/x/tour/content...")
}
-func TestInstalls(t *testing.T) {
- if testing.Short() {
- t.Skip("don't install into GOROOT in short mode")
- }
-
- tg := testgo(t)
- defer tg.cleanup()
- tg.parallel()
- tg.tempDir("gobin")
- tg.setenv("GOPATH", tg.path("."))
- goroot := runtime.GOROOT()
- tg.setenv("GOROOT", goroot)
-
- // cmd/fix installs into tool
- tg.run("env", "GOOS")
- goos := strings.TrimSpace(tg.getStdout())
- tg.setenv("GOOS", goos)
- tg.run("env", "GOARCH")
- goarch := strings.TrimSpace(tg.getStdout())
- tg.setenv("GOARCH", goarch)
- fixbin := filepath.Join(goroot, "pkg", "tool", goos+"_"+goarch, "fix") + exeSuffix
- tg.must(robustio.RemoveAll(fixbin))
- tg.run("install", "cmd/fix")
- tg.wantExecutable(fixbin, "did not install cmd/fix to $GOROOT/pkg/tool")
- tg.must(os.Remove(fixbin))
- tg.setenv("GOBIN", tg.path("gobin"))
- tg.run("install", "cmd/fix")
- tg.wantExecutable(fixbin, "did not install cmd/fix to $GOROOT/pkg/tool with $GOBIN set")
- tg.unsetenv("GOBIN")
-
- // gopath program installs into GOBIN
- tg.tempFile("src/progname/p.go", `package main; func main() {}`)
- tg.setenv("GOBIN", tg.path("gobin"))
- tg.run("install", "progname")
- tg.unsetenv("GOBIN")
- tg.wantExecutable(tg.path("gobin/progname")+exeSuffix, "did not install progname to $GOBIN/progname")
-
- // gopath program installs into GOPATH/bin
- tg.run("install", "progname")
- tg.wantExecutable(tg.path("bin/progname")+exeSuffix, "did not install progname to $GOPATH/bin/progname")
-}
-
-func TestRejectRelativeDotPathInGOPATHCommandLinePackage(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- tg.setenv("GOPATH", ".")
- tg.runFail("build", "testdata/src/go-cmd-test/helloworld.go")
- tg.grepStderr("GOPATH entry is relative", "expected an error message rejecting relative GOPATH entries")
-}
-
-func TestRejectRelativePathsInGOPATH(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- sep := string(filepath.ListSeparator)
- tg.setenv("GOPATH", sep+filepath.Join(tg.pwd(), "testdata")+sep+".")
- tg.runFail("build", "go-cmd-test")
- tg.grepStderr("GOPATH entry is relative", "expected an error message rejecting relative GOPATH entries")
-}
-
-func TestRejectRelativePathsInGOPATHCommandLinePackage(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- tg.setenv("GOPATH", "testdata")
- tg.runFail("build", "testdata/src/go-cmd-test/helloworld.go")
- tg.grepStderr("GOPATH entry is relative", "expected an error message rejecting relative GOPATH entries")
-}
-
-// Issue 21928.
-func TestRejectBlankPathsInGOPATH(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- sep := string(filepath.ListSeparator)
- tg.setenv("GOPATH", " "+sep+filepath.Join(tg.pwd(), "testdata"))
- tg.runFail("build", "go-cmd-test")
- tg.grepStderr("GOPATH entry is relative", "expected an error message rejecting relative GOPATH entries")
-}
-
-// Issue 21928.
-func TestIgnoreEmptyPathsInGOPATH(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- tg.creatingTemp("testdata/bin/go-cmd-test" + exeSuffix)
- sep := string(filepath.ListSeparator)
- tg.setenv("GOPATH", ""+sep+filepath.Join(tg.pwd(), "testdata"))
- tg.run("install", "go-cmd-test")
- tg.wantExecutable("testdata/bin/go-cmd-test"+exeSuffix, "go install go-cmd-test did not write to testdata/bin/go-cmd-test")
-}
-
// Issue 4104.
func TestGoTestWithPackageListedMultipleTimes(t *testing.T) {
tooSlow(t)
@@ -2547,57 +2162,6 @@ func TestCoverageDotImport(t *testing.T) {
checkCoverage(tg, data)
}
-// Check that coverage analysis uses set mode.
-// Also check that coverage profiles merge correctly.
-func TestCoverageUsesSetMode(t *testing.T) {
- skipIfGccgo(t, "gccgo has no cover tool")
- tooSlow(t)
- tg := testgo(t)
- defer tg.cleanup()
- tg.creatingTemp("testdata/cover.out")
- tg.run("test", "-short", "-cover", "encoding/binary", "errors", "-coverprofile=testdata/cover.out")
- data := tg.getStdout() + tg.getStderr()
- if out, err := ioutil.ReadFile("testdata/cover.out"); err != nil {
- t.Error(err)
- } else {
- if !bytes.Contains(out, []byte("mode: set")) {
- t.Error("missing mode: set")
- }
- if !bytes.Contains(out, []byte("errors.go")) {
- t.Error("missing errors.go")
- }
- if !bytes.Contains(out, []byte("binary.go")) {
- t.Error("missing binary.go")
- }
- if bytes.Count(out, []byte("mode: set")) != 1 {
- t.Error("too many mode: set")
- }
- }
- checkCoverage(tg, data)
-}
-
-func TestCoverageUsesAtomicModeForRace(t *testing.T) {
- tooSlow(t)
- if !canRace {
- t.Skip("skipping because race detector not supported")
- }
- skipIfGccgo(t, "gccgo has no cover tool")
-
- tg := testgo(t)
- defer tg.cleanup()
- tg.creatingTemp("testdata/cover.out")
- tg.run("test", "-short", "-race", "-cover", "encoding/binary", "-coverprofile=testdata/cover.out")
- data := tg.getStdout() + tg.getStderr()
- if out, err := ioutil.ReadFile("testdata/cover.out"); err != nil {
- t.Error(err)
- } else {
- if !bytes.Contains(out, []byte("mode: atomic")) {
- t.Error("missing mode: atomic")
- }
- }
- checkCoverage(tg, data)
-}
-
func TestCoverageSyncAtomicImport(t *testing.T) {
skipIfGccgo(t, "gccgo has no cover tool")
tooSlow(t)
@@ -3092,53 +2656,6 @@ func TestIssue7108(t *testing.T) {
tg.runFail("test", "notest")
}
-// cmd/go: go test -a foo does not rebuild regexp.
-func TestIssue6844(t *testing.T) {
- if testing.Short() {
- t.Skip("don't rebuild the standard library in short mode")
- }
-
- tg := testgo(t)
- defer tg.cleanup()
- tg.creatingTemp("deps.test" + exeSuffix)
- tg.run("test", "-x", "-a", "-c", "testdata/dep_test.go")
- tg.grepStderr("regexp", "go test -x -a -c testdata/dep-test.go did not rebuild regexp")
-}
-
-func TestBuildDashIInstallsDependencies(t *testing.T) {
- tooSlow(t)
-
- tg := testgo(t)
- defer tg.cleanup()
- tg.parallel()
- tg.tempFile("src/x/y/foo/foo.go", `package foo
- func F() {}`)
- tg.tempFile("src/x/y/bar/bar.go", `package bar
- import "x/y/foo"
- func F() { foo.F() }`)
- tg.setenv("GOPATH", tg.path("."))
-
- // don't let build -i overwrite runtime
- tg.wantNotStale("runtime", "", "must be non-stale before build -i")
-
- checkbar := func(desc string) {
- tg.run("build", "-v", "-i", "x/y/bar")
- tg.grepBoth("x/y/foo", "first build -i "+desc+" did not build x/y/foo")
- tg.run("build", "-v", "-i", "x/y/bar")
- tg.grepBothNot("x/y/foo", "second build -i "+desc+" built x/y/foo")
- }
- checkbar("pkg")
-
- tg.creatingTemp("bar" + exeSuffix)
- tg.sleep()
- tg.tempFile("src/x/y/foo/foo.go", `package foo
- func F() { F() }`)
- tg.tempFile("src/x/y/bar/bar.go", `package main
- import "x/y/foo"
- func main() { foo.F() }`)
- checkbar("cmd")
-}
-
func TestGoBuildTestOnly(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()
@@ -3423,95 +2940,6 @@ func TestGoGetDotSlashDownload(t *testing.T) {
tg.run("get", "./pprof_mac_fix")
}
-// Test that you cannot import a main package.
-// See golang.org/issue/4210 and golang.org/issue/17475.
-func TestImportMain(t *testing.T) {
- tooSlow(t)
-
- tg := testgo(t)
- tg.parallel()
- defer tg.cleanup()
-
- // Importing package main from that package main's test should work.
- tg.tempFile("src/x/main.go", `package main
- var X int
- func main() {}`)
- tg.tempFile("src/x/main_test.go", `package main_test
- import xmain "x"
- import "testing"
- var _ = xmain.X
- func TestFoo(t *testing.T) {}
- `)
- tg.setenv("GOPATH", tg.path("."))
- tg.creatingTemp("x" + exeSuffix)
- tg.run("build", "x")
- tg.run("test", "x")
-
- // Importing package main from another package should fail.
- tg.tempFile("src/p1/p.go", `package p1
- import xmain "x"
- var _ = xmain.X
- `)
- tg.runFail("build", "p1")
- tg.grepStderr("import \"x\" is a program, not an importable package", "did not diagnose package main")
-
- // ... even in that package's test.
- tg.tempFile("src/p2/p.go", `package p2
- `)
- tg.tempFile("src/p2/p_test.go", `package p2
- import xmain "x"
- import "testing"
- var _ = xmain.X
- func TestFoo(t *testing.T) {}
- `)
- tg.run("build", "p2")
- tg.runFail("test", "p2")
- tg.grepStderr("import \"x\" is a program, not an importable package", "did not diagnose package main")
-
- // ... even if that package's test is an xtest.
- tg.tempFile("src/p3/p.go", `package p
- `)
- tg.tempFile("src/p3/p_test.go", `package p_test
- import xmain "x"
- import "testing"
- var _ = xmain.X
- func TestFoo(t *testing.T) {}
- `)
- tg.run("build", "p3")
- tg.runFail("test", "p3")
- tg.grepStderr("import \"x\" is a program, not an importable package", "did not diagnose package main")
-
- // ... even if that package is a package main
- tg.tempFile("src/p4/p.go", `package main
- func main() {}
- `)
- tg.tempFile("src/p4/p_test.go", `package main
- import xmain "x"
- import "testing"
- var _ = xmain.X
- func TestFoo(t *testing.T) {}
- `)
- tg.creatingTemp("p4" + exeSuffix)
- tg.run("build", "p4")
- tg.runFail("test", "p4")
- tg.grepStderr("import \"x\" is a program, not an importable package", "did not diagnose package main")
-
- // ... even if that package is a package main using an xtest.
- tg.tempFile("src/p5/p.go", `package main
- func main() {}
- `)
- tg.tempFile("src/p5/p_test.go", `package main_test
- import xmain "x"
- import "testing"
- var _ = xmain.X
- func TestFoo(t *testing.T) {}
- `)
- tg.creatingTemp("p5" + exeSuffix)
- tg.run("build", "p5")
- tg.runFail("test", "p5")
- tg.grepStderr("import \"x\" is a program, not an importable package", "did not diagnose package main")
-}
-
// Test that you cannot use a local import in a package
// accessed by a non-local import (found in a GOPATH/GOROOT).
// See golang.org/issue/17475.
@@ -3822,7 +3250,17 @@ func TestGoTestRaceInstallCgo(t *testing.T) {
cgo := strings.TrimSpace(tg.stdout.String())
old, err := os.Stat(cgo)
tg.must(err)
- tg.run("test", "-race", "-i", "runtime/race")
+
+ // For this test, we don't actually care whether 'go test -race -i' succeeds.
+ // It may fail, for example, if GOROOT was installed from source as root and
+ // is now read-only.
+ // We only care that — regardless of whether it succeeds — it does not
+ // overwrite cmd/cgo.
+ runArgs := []string{"test", "-race", "-i", "runtime/race"}
+ if status := tg.doRun(runArgs); status != nil {
+ tg.t.Logf("go %v failure ignored: %v", runArgs, status)
+ }
+
new, err := os.Stat(cgo)
tg.must(err)
if !new.ModTime().Equal(old.ModTime()) {
@@ -4688,23 +4126,19 @@ func copyFile(src, dst string, perm os.FileMode) error {
return err2
}
+// TestExecutableGOROOT verifies that the cmd/go binary itself uses
+// os.Executable (when available) to locate GOROOT.
func TestExecutableGOROOT(t *testing.T) {
skipIfGccgo(t, "gccgo has no GOROOT")
- if runtime.GOOS == "openbsd" {
- t.Skipf("test case does not work on %s, missing os.Executable", runtime.GOOS)
- }
- // Env with no GOROOT.
- var env []string
- for _, e := range os.Environ() {
- if !strings.HasPrefix(e, "GOROOT=") {
- env = append(env, e)
- }
- }
+ // Note: Must not call tg methods inside subtests: tg is attached to outer t.
+ tg := testgo(t)
+ tg.unsetenv("GOROOT")
+ defer tg.cleanup()
check := func(t *testing.T, exe, want string) {
cmd := exec.Command(exe, "env", "GOROOT")
- cmd.Env = env
+ cmd.Env = tg.env
out, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("%s env GOROOT: %v, %s", exe, err, out)
@@ -4724,10 +4158,6 @@ func TestExecutableGOROOT(t *testing.T) {
}
}
- // Note: Must not call tg methods inside subtests: tg is attached to outer t.
- tg := testgo(t)
- defer tg.cleanup()
-
tg.makeTempdir()
tg.tempDir("new/bin")
newGoTool := tg.path("new/bin/go" + exeSuffix)
@@ -4774,8 +4204,9 @@ func TestExecutableGOROOT(t *testing.T) {
}
cmd := exec.Command(newGoTool, "run", "testdata/print_goroot.go")
- cmd.Env = env
- out, err := cmd.CombinedOutput()
+ cmd.Env = tg.env
+ cmd.Stderr = os.Stderr
+ out, err := cmd.Output()
if err != nil {
t.Fatalf("%s run testdata/print_goroot.go: %v, %s", newGoTool, err, out)
}
@@ -4807,36 +4238,6 @@ func TestNeedVersion(t *testing.T) {
tg.grepStderr("compile", "does not match go tool version")
}
-// Test that user can override default code generation flags.
-func TestUserOverrideFlags(t *testing.T) {
- skipIfGccgo(t, "gccgo does not use -gcflags")
- if !canCgo {
- t.Skip("skipping because cgo not enabled")
- }
- if runtime.GOOS != "linux" {
- // We are testing platform-independent code, so it's
- // OK to skip cases that work differently.
- t.Skipf("skipping on %s because test only works if c-archive implies -shared", runtime.GOOS)
- }
-
- tg := testgo(t)
- defer tg.cleanup()
- // Don't call tg.parallel, as creating override.h and override.a may
- // confuse other tests.
- tg.tempFile("override.go", `package main
-
-import "C"
-
-//export GoFunc
-func GoFunc() {}
-
-func main() {}`)
- tg.creatingTemp("override.a")
- tg.creatingTemp("override.h")
- tg.run("build", "-x", "-buildmode=c-archive", "-gcflags=all=-shared=false", tg.path("override.go"))
- tg.grepStderr("compile .*-shared .*-shared=false", "user can not override code generation flag")
-}
-
func TestCgoFlagContainsSpace(t *testing.T) {
tooSlow(t)
if !canCgo {
@@ -4939,35 +4340,31 @@ func TestTestRegexps(t *testing.T) {
// BenchmarkXX is run but only with N=1, once
// BenchmarkX/Y is run in full, twice
want := `=== RUN TestX
+ TestX: x_test.go:6: LOG: X running
=== RUN TestX/Y
- x_test.go:6: LOG: X running
- x_test.go:8: LOG: Y running
+ TestX/Y: x_test.go:8: LOG: Y running
=== RUN TestXX
- z_test.go:10: LOG: XX running
+ TestXX: z_test.go:10: LOG: XX running
=== RUN TestX
+ TestX: x_test.go:6: LOG: X running
=== RUN TestX/Y
- x_test.go:6: LOG: X running
- x_test.go:8: LOG: Y running
+ TestX/Y: x_test.go:8: LOG: Y running
=== RUN TestXX
- z_test.go:10: LOG: XX running
---- BENCH: BenchmarkX/Y
- x_test.go:15: LOG: Y running N=1
- x_test.go:15: LOG: Y running N=100
- x_test.go:15: LOG: Y running N=10000
- x_test.go:15: LOG: Y running N=1000000
- x_test.go:15: LOG: Y running N=100000000
- x_test.go:15: LOG: Y running N=1000000000
---- BENCH: BenchmarkX/Y
- x_test.go:15: LOG: Y running N=1
- x_test.go:15: LOG: Y running N=100
- x_test.go:15: LOG: Y running N=10000
- x_test.go:15: LOG: Y running N=1000000
- x_test.go:15: LOG: Y running N=100000000
- x_test.go:15: LOG: Y running N=1000000000
---- BENCH: BenchmarkX
- x_test.go:13: LOG: X running N=1
---- BENCH: BenchmarkXX
- z_test.go:18: LOG: XX running N=1
+ TestXX: z_test.go:10: LOG: XX running
+ BenchmarkX: x_test.go:13: LOG: X running N=1
+ BenchmarkX/Y: x_test.go:15: LOG: Y running N=1
+ BenchmarkX/Y: x_test.go:15: LOG: Y running N=100
+ BenchmarkX/Y: x_test.go:15: LOG: Y running N=10000
+ BenchmarkX/Y: x_test.go:15: LOG: Y running N=1000000
+ BenchmarkX/Y: x_test.go:15: LOG: Y running N=100000000
+ BenchmarkX/Y: x_test.go:15: LOG: Y running N=1000000000
+ BenchmarkX/Y: x_test.go:15: LOG: Y running N=1
+ BenchmarkX/Y: x_test.go:15: LOG: Y running N=100
+ BenchmarkX/Y: x_test.go:15: LOG: Y running N=10000
+ BenchmarkX/Y: x_test.go:15: LOG: Y running N=1000000
+ BenchmarkX/Y: x_test.go:15: LOG: Y running N=100000000
+ BenchmarkX/Y: x_test.go:15: LOG: Y running N=1000000000
+ BenchmarkXX: z_test.go:18: LOG: XX running N=1
`
have := strings.Join(lines, "")
@@ -5196,52 +4593,6 @@ func TestUpxCompression(t *testing.T) {
}
}
-// Test that Go binaries can be run under QEMU in user-emulation mode
-// (See issue #13024).
-func TestQEMUUserMode(t *testing.T) {
- if testing.Short() && testenv.Builder() == "" {
- t.Skipf("skipping in -short mode on non-builder")
- }
-
- testArchs := []struct {
- g, qemu string
- }{
- {"arm", "arm"},
- {"arm64", "aarch64"},
- }
-
- tg := testgo(t)
- defer tg.cleanup()
- tg.tempFile("main.go", `package main; import "fmt"; func main() { fmt.Print("hello qemu-user") }`)
- tg.parallel()
- src, obj := tg.path("main.go"), tg.path("main")
-
- for _, arch := range testArchs {
- arch := arch
- t.Run(arch.g, func(t *testing.T) {
- qemu := "qemu-" + arch.qemu
- testenv.MustHaveExecPath(t, qemu)
-
- out, err := exec.Command(qemu, "--version").CombinedOutput()
- if err != nil {
- t.Fatalf("%s --version failed: %v", qemu, err)
- }
-
- tg.setenv("GOARCH", arch.g)
- tg.run("build", "-o", obj, src)
-
- out, err = exec.Command(qemu, obj).CombinedOutput()
- if err != nil {
- t.Logf("%s output:\n%s\n", qemu, out)
- t.Fatalf("%s failed with %v", qemu, err)
- }
- if want := "hello qemu-user"; string(out) != want {
- t.Errorf("bad output from %s:\ngot %s; want %s", qemu, out, want)
- }
- })
- }
-}
-
func TestCacheListStale(t *testing.T) {
tooSlow(t)
if strings.Contains(os.Getenv("GODEBUG"), "gocacheverify") {
@@ -5282,38 +4633,6 @@ func TestCacheCoverage(t *testing.T) {
tg.run("test", "-cover", "-short", "math", "strings")
}
-func TestCacheVet(t *testing.T) {
- skipIfGccgo(t, "gccgo has no standard packages")
- tg := testgo(t)
- defer tg.cleanup()
- tg.parallel()
-
- if strings.Contains(os.Getenv("GODEBUG"), "gocacheverify") {
- t.Skip("GODEBUG gocacheverify")
- }
- if testing.Short() {
- // In short mode, reuse cache.
- // Test failures may be masked if the cache has just the right entries already
- // (not a concern during all.bash, which runs in a clean cache).
- if cfg.Getenv("GOCACHE") == "off" {
- tooSlow(t)
- }
- } else {
- tg.makeTempdir()
- tg.setenv("GOCACHE", tg.path("cache"))
- }
-
- // Check that second vet reuses cgo-derived inputs.
- // The first command could be build instead of vet,
- // except that if the cache is empty and there's a net.a
- // in GOROOT/pkg, the build will not bother to regenerate
- // and cache the cgo outputs, whereas vet always will.
- tg.run("vet", "os/user")
- tg.run("vet", "-x", "os/user")
- tg.grepStderrNot(`^(clang|gcc)`, "should not have run compiler")
- tg.grepStderrNot(`[\\/]cgo `, "should not have run cgo")
-}
-
func TestIssue22588(t *testing.T) {
// Don't get confused by stderr coming from tools.
tg := testgo(t)
@@ -5503,122 +4822,6 @@ func TestTestCache(t *testing.T) {
}
}
-func TestTestCacheInputs(t *testing.T) {
- tooSlow(t)
-
- if strings.Contains(os.Getenv("GODEBUG"), "gocacheverify") {
- t.Skip("GODEBUG gocacheverify")
- }
- tg := testgo(t)
- defer tg.cleanup()
- tg.parallel()
- tg.makeTempdir()
- tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
- tg.setenv("GOCACHE", tg.path("cache"))
-
- defer os.Remove(filepath.Join(tg.pwd(), "testdata/src/testcache/file.txt"))
- defer os.Remove(filepath.Join(tg.pwd(), "testdata/src/testcache/script.sh"))
- tg.must(ioutil.WriteFile(filepath.Join(tg.pwd(), "testdata/src/testcache/file.txt"), []byte("x"), 0644))
- old := time.Now().Add(-1 * time.Minute)
- tg.must(os.Chtimes(filepath.Join(tg.pwd(), "testdata/src/testcache/file.txt"), old, old))
- info, err := os.Stat(filepath.Join(tg.pwd(), "testdata/src/testcache/file.txt"))
- if err != nil {
- t.Fatal(err)
- }
- t.Logf("file.txt: old=%v, info.ModTime=%v", old, info.ModTime()) // help debug when Chtimes lies about succeeding
- tg.setenv("TESTKEY", "x")
-
- tg.must(ioutil.WriteFile(filepath.Join(tg.pwd(), "testdata/src/testcache/script.sh"), []byte("#!/bin/sh\nexit 0\n"), 0755))
- tg.must(os.Chtimes(filepath.Join(tg.pwd(), "testdata/src/testcache/script.sh"), old, old))
-
- tg.run("test", "testcache")
- tg.run("test", "testcache")
- tg.grepStdout(`\(cached\)`, "did not cache")
-
- tg.setenv("TESTKEY", "y")
- tg.run("test", "testcache")
- tg.grepStdoutNot(`\(cached\)`, "did not notice env var change")
- tg.run("test", "testcache")
- tg.grepStdout(`\(cached\)`, "did not cache")
-
- tg.run("test", "testcache", "-run=FileSize")
- tg.run("test", "testcache", "-run=FileSize")
- tg.grepStdout(`\(cached\)`, "did not cache")
- tg.must(ioutil.WriteFile(filepath.Join(tg.pwd(), "testdata/src/testcache/file.txt"), []byte("xxx"), 0644))
- tg.run("test", "testcache", "-run=FileSize")
- tg.grepStdoutNot(`\(cached\)`, "did not notice file size change")
- tg.run("test", "testcache", "-run=FileSize")
- tg.grepStdout(`\(cached\)`, "did not cache")
-
- tg.run("test", "testcache", "-run=Chdir")
- tg.run("test", "testcache", "-run=Chdir")
- tg.grepStdout(`\(cached\)`, "did not cache")
- tg.must(ioutil.WriteFile(filepath.Join(tg.pwd(), "testdata/src/testcache/file.txt"), []byte("xxxxx"), 0644))
- tg.run("test", "testcache", "-run=Chdir")
- tg.grepStdoutNot(`\(cached\)`, "did not notice file size change")
- tg.run("test", "testcache", "-run=Chdir")
- tg.grepStdout(`\(cached\)`, "did not cache")
-
- tg.must(os.Chtimes(filepath.Join(tg.pwd(), "testdata/src/testcache/file.txt"), old, old))
- tg.run("test", "testcache", "-run=FileContent")
- tg.run("test", "testcache", "-run=FileContent")
- tg.grepStdout(`\(cached\)`, "did not cache")
- tg.must(ioutil.WriteFile(filepath.Join(tg.pwd(), "testdata/src/testcache/file.txt"), []byte("yyy"), 0644))
- old2 := old.Add(10 * time.Second)
- tg.must(os.Chtimes(filepath.Join(tg.pwd(), "testdata/src/testcache/file.txt"), old2, old2))
- tg.run("test", "testcache", "-run=FileContent")
- tg.grepStdoutNot(`\(cached\)`, "did not notice file content change")
- tg.run("test", "testcache", "-run=FileContent")
- tg.grepStdout(`\(cached\)`, "did not cache")
-
- tg.run("test", "testcache", "-run=DirList")
- tg.run("test", "testcache", "-run=DirList")
- tg.grepStdout(`\(cached\)`, "did not cache")
- tg.must(os.Remove(filepath.Join(tg.pwd(), "testdata/src/testcache/file.txt")))
- tg.run("test", "testcache", "-run=DirList")
- tg.grepStdoutNot(`\(cached\)`, "did not notice directory change")
- tg.run("test", "testcache", "-run=DirList")
- tg.grepStdout(`\(cached\)`, "did not cache")
-
- tg.tempFile("file.txt", "")
- tg.must(ioutil.WriteFile(filepath.Join(tg.pwd(), "testdata/src/testcache/testcachetmp_test.go"), []byte(`package testcache
-
- import (
- "os"
- "testing"
- )
-
- func TestExternalFile(t *testing.T) {
- os.Open(`+fmt.Sprintf("%q", tg.path("file.txt"))+`)
- _, err := os.Stat(`+fmt.Sprintf("%q", tg.path("file.txt"))+`)
- if err != nil {
- t.Fatal(err)
- }
- }
- `), 0666))
- defer os.Remove(filepath.Join(tg.pwd(), "testdata/src/testcache/testcachetmp_test.go"))
- tg.run("test", "testcache", "-run=ExternalFile")
- tg.run("test", "testcache", "-run=ExternalFile")
- tg.grepStdout(`\(cached\)`, "did not cache")
- tg.must(os.Remove(filepath.Join(tg.tempdir, "file.txt")))
- tg.run("test", "testcache", "-run=ExternalFile")
- tg.grepStdout(`\(cached\)`, "did not cache")
-
- switch runtime.GOOS {
- case "nacl", "plan9", "windows":
- // no shell scripts
- default:
- tg.run("test", "testcache", "-run=Exec")
- tg.run("test", "testcache", "-run=Exec")
- tg.grepStdout(`\(cached\)`, "did not cache")
- tg.must(os.Chtimes(filepath.Join(tg.pwd(), "testdata/src/testcache/script.sh"), old2, old2))
- tg.run("test", "testcache", "-run=Exec")
- tg.grepStdoutNot(`\(cached\)`, "did not notice script change")
- tg.run("test", "testcache", "-run=Exec")
- tg.grepStdout(`\(cached\)`, "did not cache")
- }
-}
-
func TestTestVet(t *testing.T) {
tooSlow(t)
tg := testgo(t)
@@ -5761,14 +4964,6 @@ func TestInstallDeps(t *testing.T) {
tg.mustExist(p1)
}
-func TestFmtLoadErrors(t *testing.T) {
- tg := testgo(t)
- defer tg.cleanup()
- tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
- tg.runFail("fmt", "does-not-exist")
- tg.run("fmt", "-n", "exclude")
-}
-
func TestGoTestMinusN(t *testing.T) {
// Intent here is to verify that 'go test -n' works without crashing.
// This reuses flag_test.go, but really any test would do.
diff --git a/libgo/go/cmd/go/help_test.go b/libgo/go/cmd/go/help_test.go
index 9c0fa8411ee..9bcab820ce6 100644
--- a/libgo/go/cmd/go/help_test.go
+++ b/libgo/go/cmd/go/help_test.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !nacl
-
package main_test
import (
diff --git a/libgo/go/cmd/go/internal/base/flag.go b/libgo/go/cmd/go/internal/base/flag.go
index 5e03e640588..6727196816b 100644
--- a/libgo/go/cmd/go/internal/base/flag.go
+++ b/libgo/go/cmd/go/internal/base/flag.go
@@ -33,3 +33,8 @@ func AddBuildFlagsNX(flags *flag.FlagSet) {
flags.BoolVar(&cfg.BuildN, "n", false, "")
flags.BoolVar(&cfg.BuildX, "x", false, "")
}
+
+// AddLoadFlags adds the -mod build flag to the flag set.
+func AddLoadFlags(flags *flag.FlagSet) {
+ flags.StringVar(&cfg.BuildMod, "mod", "", "")
+}
diff --git a/libgo/go/cmd/go/internal/base/signal_unix.go b/libgo/go/cmd/go/internal/base/signal_unix.go
index 5aa7703ca3a..2b1507be27c 100644
--- a/libgo/go/cmd/go/internal/base/signal_unix.go
+++ b/libgo/go/cmd/go/internal/base/signal_unix.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build aix darwin dragonfly freebsd hurd js linux nacl netbsd openbsd solaris
+// +build aix darwin dragonfly freebsd hurd js linux netbsd openbsd solaris
package base
diff --git a/libgo/go/cmd/go/internal/cache/cache.go b/libgo/go/cmd/go/internal/cache/cache.go
index a05a08f75fc..87973987650 100644
--- a/libgo/go/cmd/go/internal/cache/cache.go
+++ b/libgo/go/cmd/go/internal/cache/cache.go
@@ -74,7 +74,22 @@ func (c *Cache) fileName(id [HashSize]byte, key string) string {
return filepath.Join(c.dir, fmt.Sprintf("%02x", id[0]), fmt.Sprintf("%x", id)+"-"+key)
}
-var errMissing = errors.New("cache entry not found")
+// An entryNotFoundError indicates that a cache entry was not found, with an
+// optional underlying reason.
+type entryNotFoundError struct {
+ Err error
+}
+
+func (e *entryNotFoundError) Error() string {
+ if e.Err == nil {
+ return "cache entry not found"
+ }
+ return fmt.Sprintf("cache entry not found: %v", e.Err)
+}
+
+func (e *entryNotFoundError) Unwrap() error {
+ return e.Err
+}
const (
// action entry file is "v1 <hex id> <hex out> <decimal size space-padded to 20 bytes> <unixnano space-padded to 20 bytes>\n"
@@ -93,6 +108,8 @@ const (
// GODEBUG=gocacheverify=1.
var verify = false
+var errVerifyMode = errors.New("gocachverify=1")
+
// DebugTest is set when GODEBUG=gocachetest=1 is in the environment.
var DebugTest = false
@@ -121,7 +138,7 @@ func initEnv() {
// saved file for that output ID is still available.
func (c *Cache) Get(id ActionID) (Entry, error) {
if verify {
- return Entry{}, errMissing
+ return Entry{}, &entryNotFoundError{Err: errVerifyMode}
}
return c.get(id)
}
@@ -134,47 +151,60 @@ type Entry struct {
// get is Get but does not respect verify mode, so that Put can use it.
func (c *Cache) get(id ActionID) (Entry, error) {
- missing := func() (Entry, error) {
- return Entry{}, errMissing
+ missing := func(reason error) (Entry, error) {
+ return Entry{}, &entryNotFoundError{Err: reason}
}
f, err := os.Open(c.fileName(id, "a"))
if err != nil {
- return missing()
+ return missing(err)
}
defer f.Close()
entry := make([]byte, entrySize+1) // +1 to detect whether f is too long
- if n, err := io.ReadFull(f, entry); n != entrySize || err != io.ErrUnexpectedEOF {
- return missing()
+ if n, err := io.ReadFull(f, entry); n > entrySize {
+ return missing(errors.New("too long"))
+ } else if err != io.ErrUnexpectedEOF {
+ if err == io.EOF {
+ return missing(errors.New("file is empty"))
+ }
+ return missing(err)
+ } else if n < entrySize {
+ return missing(errors.New("entry file incomplete"))
}
if entry[0] != 'v' || entry[1] != '1' || entry[2] != ' ' || entry[3+hexSize] != ' ' || entry[3+hexSize+1+hexSize] != ' ' || entry[3+hexSize+1+hexSize+1+20] != ' ' || entry[entrySize-1] != '\n' {
- return missing()
+ return missing(errors.New("invalid header"))
}
eid, entry := entry[3:3+hexSize], entry[3+hexSize:]
eout, entry := entry[1:1+hexSize], entry[1+hexSize:]
esize, entry := entry[1:1+20], entry[1+20:]
etime, entry := entry[1:1+20], entry[1+20:]
var buf [HashSize]byte
- if _, err := hex.Decode(buf[:], eid); err != nil || buf != id {
- return missing()
+ if _, err := hex.Decode(buf[:], eid); err != nil {
+ return missing(fmt.Errorf("decoding ID: %v", err))
+ } else if buf != id {
+ return missing(errors.New("mismatched ID"))
}
if _, err := hex.Decode(buf[:], eout); err != nil {
- return missing()
+ return missing(fmt.Errorf("decoding output ID: %v", err))
}
i := 0
for i < len(esize) && esize[i] == ' ' {
i++
}
size, err := strconv.ParseInt(string(esize[i:]), 10, 64)
- if err != nil || size < 0 {
- return missing()
+ if err != nil {
+ return missing(fmt.Errorf("parsing size: %v", err))
+ } else if size < 0 {
+ return missing(errors.New("negative size"))
}
i = 0
for i < len(etime) && etime[i] == ' ' {
i++
}
tm, err := strconv.ParseInt(string(etime[i:]), 10, 64)
- if err != nil || tm < 0 {
- return missing()
+ if err != nil {
+ return missing(fmt.Errorf("parsing timestamp: %v", err))
+ } else if tm < 0 {
+ return missing(errors.New("negative timestamp"))
}
c.used(c.fileName(id, "a"))
@@ -191,8 +221,11 @@ func (c *Cache) GetFile(id ActionID) (file string, entry Entry, err error) {
}
file = c.OutputFile(entry.OutputID)
info, err := os.Stat(file)
- if err != nil || info.Size() != entry.Size {
- return "", Entry{}, errMissing
+ if err != nil {
+ return "", Entry{}, &entryNotFoundError{Err: err}
+ }
+ if info.Size() != entry.Size {
+ return "", Entry{}, &entryNotFoundError{Err: errors.New("file incomplete")}
}
return file, entry, nil
}
@@ -207,7 +240,7 @@ func (c *Cache) GetBytes(id ActionID) ([]byte, Entry, error) {
}
data, _ := ioutil.ReadFile(c.OutputFile(entry.OutputID))
if sha256.Sum256(data) != entry.OutputID {
- return nil, entry, errMissing
+ return nil, entry, &entryNotFoundError{Err: errors.New("bad checksum")}
}
return data, entry, nil
}
diff --git a/libgo/go/cmd/go/internal/cfg/cfg.go b/libgo/go/cmd/go/internal/cfg/cfg.go
index a3277a6c3f0..61dc6bdda66 100644
--- a/libgo/go/cmd/go/internal/cfg/cfg.go
+++ b/libgo/go/cmd/go/internal/cfg/cfg.go
@@ -27,6 +27,7 @@ var (
BuildBuildmode string // -buildmode flag
BuildContext = defaultContext()
BuildMod string // -mod flag
+ BuildModReason string // reason -mod flag is set, if set by default
BuildI bool // -i flag
BuildLinkshared bool // -linkshared flag
BuildMSan bool // -msan flag
@@ -44,6 +45,9 @@ var (
BuildWork bool // -work flag
BuildX bool // -x flag
+ ModCacheRW bool // -modcacherw flag
+ ModFile string // -modfile flag
+
CmdName string // "build", "install", "list", "mod tidy", etc.
DebugActiongraph string // -debug-actiongraph flag (undocumented, unstable)
@@ -241,11 +245,12 @@ var (
GOPPC64 = envOr("GOPPC64", fmt.Sprintf("%s%d", "power", objabi.GOPPC64))
GOWASM = envOr("GOWASM", fmt.Sprint(objabi.GOWASM))
- GOPROXY = envOr("GOPROXY", "https://proxy.golang.org,direct")
- GOSUMDB = envOr("GOSUMDB", "sum.golang.org")
- GOPRIVATE = Getenv("GOPRIVATE")
- GONOPROXY = envOr("GONOPROXY", GOPRIVATE)
- GONOSUMDB = envOr("GONOSUMDB", GOPRIVATE)
+ GOPROXY = envOr("GOPROXY", "https://proxy.golang.org,direct")
+ GOSUMDB = envOr("GOSUMDB", "sum.golang.org")
+ GOPRIVATE = Getenv("GOPRIVATE")
+ GONOPROXY = envOr("GONOPROXY", GOPRIVATE)
+ GONOSUMDB = envOr("GONOSUMDB", GOPRIVATE)
+ GOINSECURE = Getenv("GOINSECURE")
)
// GetArchEnv returns the name and setting of the
diff --git a/libgo/go/cmd/go/internal/clean/clean.go b/libgo/go/cmd/go/internal/clean/clean.go
index f7d80ff6dc8..5f4bf4e6c8e 100644
--- a/libgo/go/cmd/go/internal/clean/clean.go
+++ b/libgo/go/cmd/go/internal/clean/clean.go
@@ -102,7 +102,7 @@ func init() {
// mentioned explicitly in the docs but they
// are part of the build flags.
- work.AddBuildFlags(CmdClean)
+ work.AddBuildFlags(CmdClean, work.DefaultBuildFlags)
}
func runClean(cmd *base.Command, args []string) {
diff --git a/libgo/go/cmd/go/internal/dirhash/hash.go b/libgo/go/cmd/go/internal/dirhash/hash.go
deleted file mode 100644
index 61d8face567..00000000000
--- a/libgo/go/cmd/go/internal/dirhash/hash.go
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package dirhash defines hashes over directory trees.
-package dirhash
-
-import (
- "archive/zip"
- "crypto/sha256"
- "encoding/base64"
- "errors"
- "fmt"
- "io"
- "os"
- "path/filepath"
- "sort"
- "strings"
-)
-
-var DefaultHash = Hash1
-
-type Hash func(files []string, open func(string) (io.ReadCloser, error)) (string, error)
-
-func Hash1(files []string, open func(string) (io.ReadCloser, error)) (string, error) {
- h := sha256.New()
- files = append([]string(nil), files...)
- sort.Strings(files)
- for _, file := range files {
- if strings.Contains(file, "\n") {
- return "", errors.New("filenames with newlines are not supported")
- }
- r, err := open(file)
- if err != nil {
- return "", err
- }
- hf := sha256.New()
- _, err = io.Copy(hf, r)
- r.Close()
- if err != nil {
- return "", err
- }
- fmt.Fprintf(h, "%x %s\n", hf.Sum(nil), file)
- }
- return "h1:" + base64.StdEncoding.EncodeToString(h.Sum(nil)), nil
-}
-
-func HashDir(dir, prefix string, hash Hash) (string, error) {
- files, err := DirFiles(dir, prefix)
- if err != nil {
- return "", err
- }
- osOpen := func(name string) (io.ReadCloser, error) {
- return os.Open(filepath.Join(dir, strings.TrimPrefix(name, prefix)))
- }
- return hash(files, osOpen)
-}
-
-func DirFiles(dir, prefix string) ([]string, error) {
- var files []string
- dir = filepath.Clean(dir)
- err := filepath.Walk(dir, func(file string, info os.FileInfo, err error) error {
- if err != nil {
- return err
- }
- if info.IsDir() {
- return nil
- }
- rel := file
- if dir != "." {
- rel = file[len(dir)+1:]
- }
- f := filepath.Join(prefix, rel)
- files = append(files, filepath.ToSlash(f))
- return nil
- })
- if err != nil {
- return nil, err
- }
- return files, nil
-}
-
-func HashZip(zipfile string, hash Hash) (string, error) {
- z, err := zip.OpenReader(zipfile)
- if err != nil {
- return "", err
- }
- defer z.Close()
- var files []string
- zfiles := make(map[string]*zip.File)
- for _, file := range z.File {
- files = append(files, file.Name)
- zfiles[file.Name] = file
- }
- zipOpen := func(name string) (io.ReadCloser, error) {
- f := zfiles[name]
- if f == nil {
- return nil, fmt.Errorf("file %q not found in zip", name) // should never happen
- }
- return f.Open()
- }
- return hash(files, zipOpen)
-}
diff --git a/libgo/go/cmd/go/internal/dirhash/hash_test.go b/libgo/go/cmd/go/internal/dirhash/hash_test.go
deleted file mode 100644
index ed463c1949c..00000000000
--- a/libgo/go/cmd/go/internal/dirhash/hash_test.go
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package dirhash
-
-import (
- "archive/zip"
- "crypto/sha256"
- "encoding/base64"
- "fmt"
- "io"
- "io/ioutil"
- "os"
- "path/filepath"
- "strings"
- "testing"
-)
-
-func h(s string) string {
- return fmt.Sprintf("%x", sha256.Sum256([]byte(s)))
-}
-
-func htop(k string, s string) string {
- sum := sha256.Sum256([]byte(s))
- return k + ":" + base64.StdEncoding.EncodeToString(sum[:])
-}
-
-func TestHash1(t *testing.T) {
- files := []string{"xyz", "abc"}
- open := func(name string) (io.ReadCloser, error) {
- return ioutil.NopCloser(strings.NewReader("data for " + name)), nil
- }
- want := htop("h1", fmt.Sprintf("%s %s\n%s %s\n", h("data for abc"), "abc", h("data for xyz"), "xyz"))
- out, err := Hash1(files, open)
- if err != nil {
- t.Fatal(err)
- }
- if out != want {
- t.Errorf("Hash1(...) = %s, want %s", out, want)
- }
-
- _, err = Hash1([]string{"xyz", "a\nbc"}, open)
- if err == nil {
- t.Error("Hash1: expected error on newline in filenames")
- }
-}
-
-func TestHashDir(t *testing.T) {
- dir, err := ioutil.TempDir("", "dirhash-test-")
- if err != nil {
- t.Fatal(err)
- }
- defer os.RemoveAll(dir)
- if err := ioutil.WriteFile(filepath.Join(dir, "xyz"), []byte("data for xyz"), 0666); err != nil {
- t.Fatal(err)
- }
- if err := ioutil.WriteFile(filepath.Join(dir, "abc"), []byte("data for abc"), 0666); err != nil {
- t.Fatal(err)
- }
- want := htop("h1", fmt.Sprintf("%s %s\n%s %s\n", h("data for abc"), "prefix/abc", h("data for xyz"), "prefix/xyz"))
- out, err := HashDir(dir, "prefix", Hash1)
- if err != nil {
- t.Fatalf("HashDir: %v", err)
- }
- if out != want {
- t.Errorf("HashDir(...) = %s, want %s", out, want)
- }
-}
-
-func TestHashZip(t *testing.T) {
- f, err := ioutil.TempFile("", "dirhash-test-")
- if err != nil {
- t.Fatal(err)
- }
- defer os.Remove(f.Name())
- defer f.Close()
-
- z := zip.NewWriter(f)
- w, err := z.Create("prefix/xyz")
- if err != nil {
- t.Fatal(err)
- }
- w.Write([]byte("data for xyz"))
- w, err = z.Create("prefix/abc")
- if err != nil {
- t.Fatal(err)
- }
- w.Write([]byte("data for abc"))
- if err := z.Close(); err != nil {
- t.Fatal(err)
- }
- if err := f.Close(); err != nil {
- t.Fatal(err)
- }
-
- want := htop("h1", fmt.Sprintf("%s %s\n%s %s\n", h("data for abc"), "prefix/abc", h("data for xyz"), "prefix/xyz"))
- out, err := HashZip(f.Name(), Hash1)
- if err != nil {
- t.Fatalf("HashDir: %v", err)
- }
- if out != want {
- t.Errorf("HashDir(...) = %s, want %s", out, want)
- }
-}
-
-func TestDirFiles(t *testing.T) {
- dir, err := ioutil.TempDir("", "dirfiles-test-")
- if err != nil {
- t.Fatal(err)
- }
- defer os.RemoveAll(dir)
- if err := ioutil.WriteFile(filepath.Join(dir, "xyz"), []byte("data for xyz"), 0666); err != nil {
- t.Fatal(err)
- }
- if err := ioutil.WriteFile(filepath.Join(dir, "abc"), []byte("data for abc"), 0666); err != nil {
- t.Fatal(err)
- }
- if err := os.Mkdir(filepath.Join(dir, "subdir"), 0777); err != nil {
- t.Fatal(err)
- }
- if err := ioutil.WriteFile(filepath.Join(dir, "subdir", "xyz"), []byte("data for subdir xyz"), 0666); err != nil {
- t.Fatal(err)
- }
- prefix := "foo/bar@v2.3.4"
- out, err := DirFiles(dir, prefix)
- if err != nil {
- t.Fatalf("DirFiles: %v", err)
- }
- for _, file := range out {
- if !strings.HasPrefix(file, prefix) {
- t.Errorf("Dir file = %s, want prefix %s", file, prefix)
- }
- }
-}
diff --git a/libgo/go/cmd/go/internal/doc/doc.go b/libgo/go/cmd/go/internal/doc/doc.go
index bad05ff9128..4ff08bb9289 100644
--- a/libgo/go/cmd/go/internal/doc/doc.go
+++ b/libgo/go/cmd/go/internal/doc/doc.go
@@ -114,6 +114,8 @@ Flags:
Treat a command (package main) like a regular package.
Otherwise package main's exported symbols are hidden
when showing the package's top-level documentation.
+ -short
+ One-line representation for each symbol.
-src
Show the full source code for the symbol. This will
display the full Go source of its declaration and
diff --git a/libgo/go/cmd/go/internal/envcmd/env.go b/libgo/go/cmd/go/internal/envcmd/env.go
index 17852deed1e..d2d5ed95076 100644
--- a/libgo/go/cmd/go/internal/envcmd/env.go
+++ b/libgo/go/cmd/go/internal/envcmd/env.go
@@ -8,6 +8,7 @@ package envcmd
import (
"encoding/json"
"fmt"
+ "go/build"
"io/ioutil"
"os"
"path/filepath"
@@ -75,6 +76,7 @@ func MkEnv() []cfg.EnvVar {
{Name: "GOFLAGS", Value: cfg.Getenv("GOFLAGS")},
{Name: "GOHOSTARCH", Value: runtime.GOARCH},
{Name: "GOHOSTOS", Value: runtime.GOOS},
+ {Name: "GOINSECURE", Value: cfg.GOINSECURE},
{Name: "GONOPROXY", Value: cfg.GONOPROXY},
{Name: "GONOSUMDB", Value: cfg.GONOSUMDB},
{Name: "GOOS", Value: cfg.Goos},
@@ -237,7 +239,7 @@ func runEnv(cmd *base.Command, args []string) {
base.Fatalf("go env -w: arguments must be KEY=VALUE: invalid argument: %s", arg)
}
key, val := arg[:i], arg[i+1:]
- if err := checkEnvWrite(key, val, env); err != nil {
+ if err := checkEnvWrite(key, val); err != nil {
base.Fatalf("go env -w: %v", err)
}
if _, ok := add[key]; ok {
@@ -248,6 +250,21 @@ func runEnv(cmd *base.Command, args []string) {
fmt.Fprintf(os.Stderr, "warning: go env -w %s=... does not override conflicting OS environment variable\n", key)
}
}
+
+ goos, okGOOS := add["GOOS"]
+ goarch, okGOARCH := add["GOARCH"]
+ if okGOOS || okGOARCH {
+ if !okGOOS {
+ goos = cfg.Goos
+ }
+ if !okGOARCH {
+ goarch = cfg.Goarch
+ }
+ if err := work.CheckGOOSARCHPair(goos, goarch); err != nil {
+ base.Fatalf("go env -w: %v", err)
+ }
+ }
+
updateEnvFile(add, nil)
return
}
@@ -259,11 +276,29 @@ func runEnv(cmd *base.Command, args []string) {
}
del := make(map[string]bool)
for _, arg := range args {
- if err := checkEnvWrite(arg, "", env); err != nil {
+ if err := checkEnvWrite(arg, ""); err != nil {
base.Fatalf("go env -u: %v", err)
}
del[arg] = true
}
+ if del["GOOS"] || del["GOARCH"] {
+ goos, goarch := cfg.Goos, cfg.Goarch
+ if del["GOOS"] {
+ goos = getOrigEnv("GOOS")
+ if goos == "" {
+ goos = build.Default.GOOS
+ }
+ }
+ if del["GOARCH"] {
+ goarch = getOrigEnv("GOARCH")
+ if goarch == "" {
+ goarch = build.Default.GOARCH
+ }
+ }
+ if err := work.CheckGOOSARCHPair(goos, goarch); err != nil {
+ base.Fatalf("go env -u: %v", err)
+ }
+ }
updateEnvFile(nil, del)
return
}
@@ -330,7 +365,16 @@ func printEnvAsJSON(env []cfg.EnvVar) {
}
}
-func checkEnvWrite(key, val string, env []cfg.EnvVar) error {
+func getOrigEnv(key string) string {
+ for _, v := range cfg.OrigEnv {
+ if strings.HasPrefix(v, key+"=") {
+ return strings.TrimPrefix(v, key+"=")
+ }
+ }
+ return ""
+}
+
+func checkEnvWrite(key, val string) error {
switch key {
case "GOEXE", "GOGCCFLAGS", "GOHOSTARCH", "GOHOSTOS", "GOMOD", "GOTOOLDIR":
return fmt.Errorf("%s cannot be modified", key)
@@ -343,6 +387,25 @@ func checkEnvWrite(key, val string, env []cfg.EnvVar) error {
return fmt.Errorf("unknown go command variable %s", key)
}
+ // Some variables can only have one of a few valid values. If set to an
+ // invalid value, the next cmd/go invocation might fail immediately,
+ // even 'go env -w' itself.
+ switch key {
+ case "GO111MODULE":
+ switch val {
+ case "", "auto", "on", "off":
+ default:
+ return fmt.Errorf("invalid %s value %q", key, val)
+ }
+ case "GOPATH":
+ if strings.HasPrefix(val, "~") {
+ return fmt.Errorf("GOPATH entry cannot start with shell metacharacter '~': %q", val)
+ }
+ if !filepath.IsAbs(val) && val != "" {
+ return fmt.Errorf("GOPATH entry is relative; must be absolute path: %q", val)
+ }
+ }
+
if !utf8.ValidString(val) {
return fmt.Errorf("invalid UTF-8 in %s=... value", key)
}
diff --git a/libgo/go/cmd/go/internal/fmtcmd/fmt.go b/libgo/go/cmd/go/internal/fmtcmd/fmt.go
index 8e4ef372816..408af52ffa0 100644
--- a/libgo/go/cmd/go/internal/fmtcmd/fmt.go
+++ b/libgo/go/cmd/go/internal/fmtcmd/fmt.go
@@ -22,6 +22,7 @@ import (
func init() {
base.AddBuildFlagsNX(&CmdFmt.Flag)
+ base.AddLoadFlags(&CmdFmt.Flag)
}
var CmdFmt = &base.Command{
@@ -38,6 +39,9 @@ For more about specifying packages, see 'go help packages'.
The -n flag prints commands that would be executed.
The -x flag prints commands as they are executed.
+The -mod flag's value sets which module download mode
+to use: readonly or vendor. See 'go help modules' for more.
+
To run gofmt with specific options, run gofmt itself.
See also: go fix, go vet.
@@ -68,7 +72,7 @@ func runFmt(cmd *base.Command, args []string) {
continue
}
if pkg.Error != nil {
- if strings.HasPrefix(pkg.Error.Err, "build constraints exclude all Go files") {
+ if strings.HasPrefix(pkg.Error.Err.Error(), "build constraints exclude all Go files") {
// Skip this error, as we will format
// all files regardless.
} else {
diff --git a/libgo/go/cmd/go/internal/generate/generate.go b/libgo/go/cmd/go/internal/generate/generate.go
index f2ae80e5dc6..198ca1c1b94 100644
--- a/libgo/go/cmd/go/internal/generate/generate.go
+++ b/libgo/go/cmd/go/internal/generate/generate.go
@@ -149,7 +149,7 @@ var (
)
func init() {
- work.AddBuildFlags(CmdGenerate)
+ work.AddBuildFlags(CmdGenerate, work.DefaultBuildFlags)
CmdGenerate.Flag.StringVar(&generateRunFlag, "run", "", "")
}
diff --git a/libgo/go/cmd/go/internal/get/discovery.go b/libgo/go/cmd/go/internal/get/discovery.go
index 6ba5c091e39..afa6ef455f9 100644
--- a/libgo/go/cmd/go/internal/get/discovery.go
+++ b/libgo/go/cmd/go/internal/get/discovery.go
@@ -11,15 +11,15 @@ import (
"strings"
)
-// charsetReader returns a reader for the given charset. Currently
-// it only supports UTF-8 and ASCII. Otherwise, it returns a meaningful
+// charsetReader returns a reader that converts from the given charset to UTF-8.
+// Currently it only supports UTF-8 and ASCII. Otherwise, it returns a meaningful
// error which is printed by go get, so the user can find why the package
// wasn't downloaded if the encoding is not supported. Note that, in
// order to reduce potential errors, ASCII is treated as UTF-8 (i.e. characters
// greater than 0x7f are not rejected).
func charsetReader(charset string, input io.Reader) (io.Reader, error) {
switch strings.ToLower(charset) {
- case "ascii":
+ case "utf-8", "ascii":
return input, nil
default:
return nil, fmt.Errorf("can't decode XML document using charset %q", charset)
@@ -28,16 +28,16 @@ func charsetReader(charset string, input io.Reader) (io.Reader, error) {
// parseMetaGoImports returns meta imports from the HTML in r.
// Parsing ends at the end of the <head> section or the beginning of the <body>.
-func parseMetaGoImports(r io.Reader, mod ModuleMode) (imports []metaImport, err error) {
+func parseMetaGoImports(r io.Reader, mod ModuleMode) ([]metaImport, error) {
d := xml.NewDecoder(r)
d.CharsetReader = charsetReader
d.Strict = false
- var t xml.Token
+ var imports []metaImport
for {
- t, err = d.RawToken()
+ t, err := d.RawToken()
if err != nil {
- if err == io.EOF || len(imports) > 0 {
- err = nil
+ if err != io.EOF && len(imports) == 0 {
+ return nil, err
}
break
}
diff --git a/libgo/go/cmd/go/internal/get/get.go b/libgo/go/cmd/go/internal/get/get.go
index e4945fe1440..500e3e0da6d 100644
--- a/libgo/go/cmd/go/internal/get/get.go
+++ b/libgo/go/cmd/go/internal/get/get.go
@@ -108,7 +108,7 @@ var (
)
func init() {
- work.AddBuildFlags(CmdGet)
+ work.AddBuildFlags(CmdGet, work.OmitModFlag|work.OmitModCommonFlags)
CmdGet.Run = runGet // break init loop
CmdGet.Flag.BoolVar(&Insecure, "insecure", Insecure, "")
}
@@ -274,7 +274,7 @@ func download(arg string, parent *load.Package, stk *load.ImportStack, mode int)
stk.Push(arg)
err := downloadPackage(p)
if err != nil {
- base.Errorf("%s", &load.PackageError{ImportStack: stk.Copy(), Err: err.Error()})
+ base.Errorf("%s", &load.PackageError{ImportStack: stk.Copy(), Err: err})
stk.Pop()
return
}
@@ -355,7 +355,7 @@ func download(arg string, parent *load.Package, stk *load.ImportStack, mode int)
stk.Push(path)
err := &load.PackageError{
ImportStack: stk.Copy(),
- Err: "must be imported as " + path[j+len("vendor/"):],
+ Err: load.ImportErrorf(path, "%s must be imported as %s", path, path[j+len("vendor/"):]),
}
stk.Pop()
base.Errorf("%s", err)
diff --git a/libgo/go/cmd/go/internal/get/path.go b/libgo/go/cmd/go/internal/get/path.go
index 67d7b8a47c2..ce2e0cdd709 100644
--- a/libgo/go/cmd/go/internal/get/path.go
+++ b/libgo/go/cmd/go/internal/get/path.go
@@ -11,7 +11,7 @@ import (
"unicode/utf8"
)
-// The following functions are copied verbatim from cmd/go/internal/module/module.go,
+// The following functions are copied verbatim from golang.org/x/mod/module/module.go,
// with a change to additionally reject Windows short-names,
// and one to accept arbitrary letters (golang.org/issue/29101).
//
@@ -44,9 +44,6 @@ func checkPath(path string, fileName bool) error {
if path[0] == '-' {
return fmt.Errorf("leading dash")
}
- if strings.Contains(path, "..") {
- return fmt.Errorf("double dot")
- }
if strings.Contains(path, "//") {
return fmt.Errorf("double slash")
}
diff --git a/libgo/go/cmd/go/internal/get/vcs.go b/libgo/go/cmd/go/internal/get/vcs.go
index 705bb66dbe2..2e4d6388cfe 100644
--- a/libgo/go/cmd/go/internal/get/vcs.go
+++ b/libgo/go/cmd/go/internal/get/vcs.go
@@ -21,6 +21,7 @@ import (
"cmd/go/internal/base"
"cmd/go/internal/cfg"
+ "cmd/go/internal/load"
"cmd/go/internal/web"
)
@@ -531,12 +532,12 @@ func (v *vcsCmd) tagSync(dir, tag string) error {
// A vcsPath describes how to convert an import path into a
// version control system and repository name.
type vcsPath struct {
- prefix string // prefix this description applies to
- regexp *lazyregexp.Regexp // compiled pattern for import path
- repo string // repository to use (expand with match of re)
- vcs string // version control system to use (expand with match of re)
- check func(match map[string]string) error // additional checks
- ping bool // ping for scheme to use to download repo
+ prefix string // prefix this description applies to
+ regexp *lazyregexp.Regexp // compiled pattern for import path
+ repo string // repository to use (expand with match of re)
+ vcs string // version control system to use (expand with match of re)
+ check func(match map[string]string) error // additional checks
+ schemelessRepo bool // if true, the repo pattern lacks a scheme
}
// vcsFromDir inspects dir and its parents to determine the
@@ -657,15 +658,15 @@ const (
// RepoRootForImportPath analyzes importPath to determine the
// version control system, and code repository to use.
func RepoRootForImportPath(importPath string, mod ModuleMode, security web.SecurityMode) (*RepoRoot, error) {
- rr, err := repoRootFromVCSPaths(importPath, "", security, vcsPaths)
+ rr, err := repoRootFromVCSPaths(importPath, security, vcsPaths)
if err == errUnknownSite {
rr, err = repoRootForImportDynamic(importPath, mod, security)
if err != nil {
- err = fmt.Errorf("unrecognized import path %q (%v)", importPath, err)
+ err = load.ImportErrorf(importPath, "unrecognized import path %q: %v", importPath, err)
}
}
if err != nil {
- rr1, err1 := repoRootFromVCSPaths(importPath, "", security, vcsPathsAfterDynamic)
+ rr1, err1 := repoRootFromVCSPaths(importPath, security, vcsPathsAfterDynamic)
if err1 == nil {
rr = rr1
err = nil
@@ -676,7 +677,7 @@ func RepoRootForImportPath(importPath string, mod ModuleMode, security web.Secur
if err == nil && strings.Contains(importPath, "...") && strings.Contains(rr.Root, "...") {
// Do not allow wildcards in the repo root.
rr = nil
- err = fmt.Errorf("cannot expand ... in %q", importPath)
+ err = load.ImportErrorf(importPath, "cannot expand ... in %q", importPath)
}
return rr, err
}
@@ -685,8 +686,7 @@ var errUnknownSite = errors.New("dynamic lookup required to find mapping")
// repoRootFromVCSPaths attempts to map importPath to a repoRoot
// using the mappings defined in vcsPaths.
-// If scheme is non-empty, that scheme is forced.
-func repoRootFromVCSPaths(importPath, scheme string, security web.SecurityMode, vcsPaths []*vcsPath) (*RepoRoot, error) {
+func repoRootFromVCSPaths(importPath string, security web.SecurityMode, vcsPaths []*vcsPath) (*RepoRoot, error) {
// A common error is to use https://packagepath because that's what
// hg and git require. Diagnose this helpfully.
if prefix := httpPrefix(importPath); prefix != "" {
@@ -701,7 +701,7 @@ func repoRootFromVCSPaths(importPath, scheme string, security web.SecurityMode,
m := srv.regexp.FindStringSubmatch(importPath)
if m == nil {
if srv.prefix != "" {
- return nil, fmt.Errorf("invalid %s import path %q", srv.prefix, importPath)
+ return nil, load.ImportErrorf(importPath, "invalid %s import path %q", srv.prefix, importPath)
}
continue
}
@@ -731,26 +731,28 @@ func repoRootFromVCSPaths(importPath, scheme string, security web.SecurityMode,
if vcs == nil {
return nil, fmt.Errorf("unknown version control system %q", match["vcs"])
}
- if srv.ping {
- if scheme != "" {
- match["repo"] = scheme + "://" + match["repo"]
- } else {
- for _, scheme := range vcs.scheme {
- if security == web.SecureOnly && !vcs.isSecureScheme(scheme) {
+ var repoURL string
+ if !srv.schemelessRepo {
+ repoURL = match["repo"]
+ } else {
+ scheme := vcs.scheme[0] // default to first scheme
+ repo := match["repo"]
+ if vcs.pingCmd != "" {
+ // If we know how to test schemes, scan to find one.
+ for _, s := range vcs.scheme {
+ if security == web.SecureOnly && !vcs.isSecureScheme(s) {
continue
}
- if vcs.pingCmd != "" && vcs.ping(scheme, match["repo"]) == nil {
- match["repo"] = scheme + "://" + match["repo"]
- goto Found
+ if vcs.ping(s, repo) == nil {
+ scheme = s
+ break
}
}
- // No scheme found. Fall back to the first one.
- match["repo"] = vcs.scheme[0] + "://" + match["repo"]
- Found:
}
+ repoURL = scheme + "://" + repo
}
rr := &RepoRoot{
- Repo: match["repo"],
+ Repo: repoURL,
Root: match["root"],
VCS: vcs.cmd,
vcs: vcs,
@@ -799,6 +801,13 @@ func repoRootForImportDynamic(importPath string, mod ModuleMode, security web.Se
body := resp.Body
defer body.Close()
imports, err := parseMetaGoImports(body, mod)
+ if len(imports) == 0 {
+ if respErr := resp.Err(); respErr != nil {
+ // If the server's status was not OK, prefer to report that instead of
+ // an XML parse error.
+ return nil, respErr
+ }
+ }
if err != nil {
return nil, fmt.Errorf("parsing %s: %v", importPath, err)
}
@@ -904,16 +913,23 @@ func metaImportsForPrefix(importPrefix string, mod ModuleMode, security web.Secu
}
resp, err := web.Get(security, url)
if err != nil {
- return setCache(fetchResult{url: url, err: fmt.Errorf("fetch %s: %v", resp.URL, err)})
+ return setCache(fetchResult{url: url, err: fmt.Errorf("fetching %s: %v", importPrefix, err)})
}
body := resp.Body
defer body.Close()
imports, err := parseMetaGoImports(body, mod)
+ if len(imports) == 0 {
+ if respErr := resp.Err(); respErr != nil {
+ // If the server's status was not OK, prefer to report that instead of
+ // an XML parse error.
+ return setCache(fetchResult{url: url, err: respErr})
+ }
+ }
if err != nil {
return setCache(fetchResult{url: url, err: fmt.Errorf("parsing %s: %v", resp.URL, err)})
}
if len(imports) == 0 {
- err = fmt.Errorf("fetch %s: no go-import meta tag", url)
+ err = fmt.Errorf("fetching %s: no go-import meta tag found in %s", importPrefix, resp.URL)
}
return setCache(fetchResult{url: url, imports: imports, err: err})
})
@@ -962,7 +978,7 @@ func (m ImportMismatchError) Error() string {
// matchGoImport returns the metaImport from imports matching importPath.
// An error is returned if there are multiple matches.
-// errNoMatch is returned if none match.
+// An ImportMismatchError is returned if none match.
func matchGoImport(imports []metaImport, importPath string) (metaImport, error) {
match := -1
@@ -1061,8 +1077,8 @@ var vcsPaths = []*vcsPath{
// General syntax for any server.
// Must be last.
{
- regexp: lazyregexp.New(`(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?(/~?[A-Za-z0-9_.\-]+)+?)\.(?P<vcs>bzr|fossil|git|hg|svn))(/~?[A-Za-z0-9_.\-]+)*$`),
- ping: true,
+ regexp: lazyregexp.New(`(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?(/~?[A-Za-z0-9_.\-]+)+?)\.(?P<vcs>bzr|fossil|git|hg|svn))(/~?[A-Za-z0-9_.\-]+)*$`),
+ schemelessRepo: true,
},
}
diff --git a/libgo/go/cmd/go/internal/help/helpdoc.go b/libgo/go/cmd/go/internal/help/helpdoc.go
index dfb89d4910b..6a843f459a8 100644
--- a/libgo/go/cmd/go/internal/help/helpdoc.go
+++ b/libgo/go/cmd/go/internal/help/helpdoc.go
@@ -21,8 +21,8 @@ http://swig.org/. When running go build, any file with a .swig
extension will be passed to SWIG. Any file with a .swigcxx extension
will be passed to SWIG with the -c++ option.
-When either cgo or SWIG is used, go build will pass any .c, .m, .s,
-or .S files to the C compiler, and any .cc, .cpp, .cxx files to the C++
+When either cgo or SWIG is used, go build will pass any .c, .m, .s, .S
+or .sx files to the C compiler, and any .cc, .cpp, .cxx files to the C++
compiler. The CC or CXX environment variables may be set to determine
the C or C++ compiler, respectively, to use.
`,
@@ -506,6 +506,10 @@ General-purpose environment variables:
Because the entries are space-separated, flag values must
not contain spaces. Flags listed on the command line
are applied after this list and therefore override it.
+ GOINSECURE
+ Comma-separated list of glob patterns (in the syntax of Go's path.Match)
+ of module path prefixes that should always be fetched in an insecure
+ manner. Only applies to dependencies that are being fetched directly.
GOOS
The operating system for which to compile code.
Examples are linux, darwin, windows, netbsd.
@@ -617,8 +621,10 @@ Additional information available from 'go env' but not read from the environment
GOHOSTOS
The operating system (GOOS) of the Go toolchain binaries.
GOMOD
- The absolute path to the go.mod of the main module,
- or the empty string if not using modules.
+ The absolute path to the go.mod of the main module.
+ If module-aware mode is enabled, but there is no go.mod, GOMOD will be
+ os.DevNull ("/dev/null" on Unix-like systems, "NUL" on Windows).
+ If module-aware mode is disabled, GOMOD will be the empty string.
GOTOOLDIR
The directory where the go tools (compile, cover, doc, etc...) are installed.
`,
@@ -645,7 +651,7 @@ the extension of the file name. These extensions are:
.m
Objective-C source files. Only useful with cgo, and always
compiled with the OS-native compiler.
- .s, .S
+ .s, .S, .sx
Assembler source files.
If the package uses cgo or SWIG, these will be assembled with the
OS-native assembler (typically gcc (sic)); otherwise they
diff --git a/libgo/go/cmd/go/internal/imports/build.go b/libgo/go/cmd/go/internal/imports/build.go
index 3e9fe357e07..eb070eef4c1 100644
--- a/libgo/go/cmd/go/internal/imports/build.go
+++ b/libgo/go/cmd/go/internal/imports/build.go
@@ -210,7 +210,7 @@ var KnownOS = map[string]bool{
"illumos": true,
"js": true,
"linux": true,
- "nacl": true,
+ "nacl": true, // legacy; don't remove
"netbsd": true,
"openbsd": true,
"plan9": true,
@@ -222,7 +222,7 @@ var KnownOS = map[string]bool{
var KnownArch = map[string]bool{
"386": true,
"amd64": true,
- "amd64p32": true,
+ "amd64p32": true, // legacy; don't remove
"arm": true,
"armbe": true,
"arm64": true,
diff --git a/libgo/go/cmd/go/internal/list/list.go b/libgo/go/cmd/go/internal/list/list.go
index a5f1abe64ae..b393c67ddb2 100644
--- a/libgo/go/cmd/go/internal/list/list.go
+++ b/libgo/go/cmd/go/internal/list/list.go
@@ -287,7 +287,7 @@ For more about modules, see 'go help modules'.
func init() {
CmdList.Run = runList // break init cycle
- work.AddBuildFlags(CmdList)
+ work.AddBuildFlags(CmdList, work.DefaultBuildFlags)
}
var (
@@ -384,6 +384,22 @@ func runList(cmd *base.Command, args []string) {
if modload.Init(); !modload.Enabled() {
base.Fatalf("go list -m: not using modules")
}
+
+ modload.InitMod() // Parses go.mod and sets cfg.BuildMod.
+ if cfg.BuildMod == "vendor" {
+ for _, arg := range args {
+ // In vendor mode, the module graph is incomplete: it contains only the
+ // explicit module dependencies and the modules that supply packages in
+ // the import graph. Reject queries that imply more information than that.
+ if arg == "all" {
+ base.Fatalf("go list -m: can't compute 'all' using the vendor directory\n\t(Use -mod=mod or -mod=readonly to bypass.)")
+ }
+ if strings.Contains(arg, "...") {
+ base.Fatalf("go list -m: can't match module patterns using the vendor directory\n\t(Use -mod=mod or -mod=readonly to bypass.)")
+ }
+ }
+ }
+
modload.LoadBuildList()
mods := modload.ListModules(args, *listU, *listVersions)
diff --git a/libgo/go/cmd/go/internal/load/pkg.go b/libgo/go/cmd/go/internal/load/pkg.go
index a50450ee054..06b6e23e633 100644
--- a/libgo/go/cmd/go/internal/load/pkg.go
+++ b/libgo/go/cmd/go/internal/load/pkg.go
@@ -7,9 +7,11 @@ package load
import (
"bytes"
+ "encoding/json"
"errors"
"fmt"
"go/build"
+ "go/scanner"
"go/token"
"io/ioutil"
"os"
@@ -40,7 +42,7 @@ var (
ModPackageModuleInfo func(path string) *modinfo.ModulePublic // return module info for Package struct
ModImportPaths func(args []string) []*search.Match // expand import paths
ModPackageBuildInfo func(main string, deps []string) string // return module info to embed in binary
- ModInfoProg func(info string) []byte // wrap module info in .go code for binary
+ ModInfoProg func(info string, isgccgo bool) []byte // wrap module info in .go code for binary
ModImportFromFiles func([]string) // update go.mod to add modules for imports in these files
ModDirImportPath func(string) string // return effective import path for directory
)
@@ -304,9 +306,9 @@ func (p *Package) copyBuild(pp *build.Package) {
type PackageError struct {
ImportStack []string // shortest path from package named on command line to this one
Pos string // position of error
- Err string // the error itself
- IsImportCycle bool `json:"-"` // the error is an import cycle
- Hard bool `json:"-"` // whether the error is soft or hard; soft errors are ignored in some places
+ Err error // the error itself
+ IsImportCycle bool // the error is an import cycle
+ Hard bool // whether the error is soft or hard; soft errors are ignored in some places
}
func (p *PackageError) Error() string {
@@ -317,12 +319,77 @@ func (p *PackageError) Error() string {
if p.Pos != "" {
// Omit import stack. The full path to the file where the error
// is the most important thing.
- return p.Pos + ": " + p.Err
+ return p.Pos + ": " + p.Err.Error()
}
- if len(p.ImportStack) == 0 {
- return p.Err
+
+ // If the error is an ImportPathError, and the last path on the stack appears
+ // in the error message, omit that path from the stack to avoid repetition.
+ // If an ImportPathError wraps another ImportPathError that matches the
+ // last path on the stack, we don't omit the path. An error like
+ // "package A imports B: error loading C caused by B" would not be clearer
+ // if "imports B" were omitted.
+ stack := p.ImportStack
+ var ierr ImportPathError
+ if len(stack) > 0 && errors.As(p.Err, &ierr) && ierr.ImportPath() == stack[len(stack)-1] {
+ stack = stack[:len(stack)-1]
+ }
+ if len(stack) == 0 {
+ return p.Err.Error()
+ }
+ return "package " + strings.Join(stack, "\n\timports ") + ": " + p.Err.Error()
+}
+
+// PackageError implements MarshalJSON so that Err is marshaled as a string
+// and non-essential fields are omitted.
+func (p *PackageError) MarshalJSON() ([]byte, error) {
+ perr := struct {
+ ImportStack []string
+ Pos string
+ Err string
+ }{p.ImportStack, p.Pos, p.Err.Error()}
+ return json.Marshal(perr)
+}
+
+// ImportPathError is a type of error that prevents a package from being loaded
+// for a given import path. When such a package is loaded, a *Package is
+// returned with Err wrapping an ImportPathError: the error is attached to
+// the imported package, not the importing package.
+//
+// The string returned by ImportPath must appear in the string returned by
+// Error. Errors that wrap ImportPathError (such as PackageError) may omit
+// the import path.
+type ImportPathError interface {
+ error
+ ImportPath() string
+}
+
+type importError struct {
+ importPath string
+ err error // created with fmt.Errorf
+}
+
+var _ ImportPathError = (*importError)(nil)
+
+func ImportErrorf(path, format string, args ...interface{}) ImportPathError {
+ err := &importError{importPath: path, err: fmt.Errorf(format, args...)}
+ if errStr := err.Error(); !strings.Contains(errStr, path) {
+ panic(fmt.Sprintf("path %q not in error %q", path, errStr))
}
- return "package " + strings.Join(p.ImportStack, "\n\timports ") + ": " + p.Err
+ return err
+}
+
+func (e *importError) Error() string {
+ return e.err.Error()
+}
+
+func (e *importError) Unwrap() error {
+ // Don't return e.err directly, since we're only wrapping an error if %w
+ // was passed to ImportErrorf.
+ return errors.Unwrap(e.err)
+}
+
+func (e *importError) ImportPath() string {
+ return e.importPath
}
// An ImportStack is a stack of import paths, possibly with the suffix " (test)" appended.
@@ -489,7 +556,7 @@ func loadImport(pre *preload, path, srcDir string, parent *Package, stk *ImportS
ImportPath: path,
Error: &PackageError{
ImportStack: stk.Copy(),
- Err: err.Error(),
+ Err: err,
},
},
}
@@ -516,7 +583,7 @@ func loadImport(pre *preload, path, srcDir string, parent *Package, stk *ImportS
if !cfg.ModulesEnabled && path != cleanImport(path) {
p.Error = &PackageError{
ImportStack: stk.Copy(),
- Err: fmt.Sprintf("non-canonical import path: %q should be %q", path, pathpkg.Clean(path)),
+ Err: fmt.Errorf("non-canonical import path: %q should be %q", path, pathpkg.Clean(path)),
}
p.Incomplete = true
}
@@ -527,7 +594,7 @@ func loadImport(pre *preload, path, srcDir string, parent *Package, stk *ImportS
return setErrorPos(perr, importPos)
}
if mode&ResolveImport != 0 {
- if perr := disallowVendor(srcDir, parent, parentPath, path, p, stk); perr != p {
+ if perr := disallowVendor(srcDir, path, p, stk); perr != p {
return setErrorPos(perr, importPos)
}
}
@@ -536,20 +603,22 @@ func loadImport(pre *preload, path, srcDir string, parent *Package, stk *ImportS
perr := *p
perr.Error = &PackageError{
ImportStack: stk.Copy(),
- Err: fmt.Sprintf("import %q is a program, not an importable package", path),
+ Err: ImportErrorf(path, "import %q is a program, not an importable package", path),
}
return setErrorPos(&perr, importPos)
}
if p.Internal.Local && parent != nil && !parent.Internal.Local {
perr := *p
- errMsg := fmt.Sprintf("local import %q in non-local package", path)
+ var err error
if path == "." {
- errMsg = "cannot import current directory"
+ err = ImportErrorf(path, "%s: cannot import current directory", path)
+ } else {
+ err = ImportErrorf(path, "local import %q in non-local package", path)
}
perr.Error = &PackageError{
ImportStack: stk.Copy(),
- Err: errMsg,
+ Err: err,
}
return setErrorPos(&perr, importPos)
}
@@ -602,6 +671,11 @@ func loadPackageData(path, parentPath, parentDir, parentRoot string, parentIsStd
// we create from the full directory to the package.
// Otherwise it is the usual import path.
// For vendored imports, it is the expanded form.
+ //
+ // Note that when modules are enabled, local import paths are normally
+ // canonicalized by modload.ImportPaths before now. However, if there's an
+ // error resolving a local path, it will be returned untransformed
+ // so that 'go list -e' reports something useful.
importKey := importSpec{
path: path,
parentPath: parentPath,
@@ -1125,7 +1199,7 @@ func reusePackage(p *Package, stk *ImportStack) *Package {
if p.Error == nil {
p.Error = &PackageError{
ImportStack: stk.Copy(),
- Err: "import cycle not allowed",
+ Err: errors.New("import cycle not allowed"),
IsImportCycle: true,
}
}
@@ -1234,7 +1308,7 @@ func disallowInternal(srcDir string, importer *Package, importerPath string, p *
perr := *p
perr.Error = &PackageError{
ImportStack: stk.Copy(),
- Err: "use of internal package " + p.ImportPath + " not allowed",
+ Err: ImportErrorf(p.ImportPath, "use of internal package "+p.ImportPath+" not allowed"),
}
perr.Incomplete = true
return &perr
@@ -1259,11 +1333,10 @@ func findInternal(path string) (index int, ok bool) {
return 0, false
}
-// disallowVendor checks that srcDir (containing package importerPath, if non-empty)
-// is allowed to import p as path.
+// disallowVendor checks that srcDir is allowed to import p as path.
// If the import is allowed, disallowVendor returns the original package p.
// If not, it returns a new package containing just an appropriate error.
-func disallowVendor(srcDir string, importer *Package, importerPath, path string, p *Package, stk *ImportStack) *Package {
+func disallowVendor(srcDir string, path string, p *Package, stk *ImportStack) *Package {
// The stack includes p.ImportPath.
// If that's the only thing on the stack, we started
// with a name given on the command line, not an
@@ -1281,7 +1354,7 @@ func disallowVendor(srcDir string, importer *Package, importerPath, path string,
perr := *p
perr.Error = &PackageError{
ImportStack: stk.Copy(),
- Err: "must be imported as " + path[i+len("vendor/"):],
+ Err: ImportErrorf(path, "%s must be imported as %s", path, path[i+len("vendor/"):]),
}
perr.Incomplete = true
return &perr
@@ -1335,7 +1408,7 @@ func disallowVendorVisibility(srcDir string, p *Package, stk *ImportStack) *Pack
perr := *p
perr.Error = &PackageError{
ImportStack: stk.Copy(),
- Err: "use of vendored package not allowed",
+ Err: errors.New("use of vendored package not allowed"),
}
perr.Incomplete = true
return &perr
@@ -1397,26 +1470,51 @@ var cgoSyscallExclude = map[string]bool{
var foldPath = make(map[string]string)
-// DefaultExecName returns the default executable name
-// for a package with the import path importPath.
+// exeFromImportPath returns an executable name
+// for a package using the import path.
//
-// The default executable name is the last element of the import path.
+// The executable name is the last element of the import path.
// In module-aware mode, an additional rule is used on import paths
// consisting of two or more path elements. If the last element is
// a vN path element specifying the major version, then the
// second last element of the import path is used instead.
-func DefaultExecName(importPath string) string {
- _, elem := pathpkg.Split(importPath)
+func (p *Package) exeFromImportPath() string {
+ _, elem := pathpkg.Split(p.ImportPath)
if cfg.ModulesEnabled {
// If this is example.com/mycmd/v2, it's more useful to
// install it as mycmd than as v2. See golang.org/issue/24667.
- if elem != importPath && isVersionElement(elem) {
- _, elem = pathpkg.Split(pathpkg.Dir(importPath))
+ if elem != p.ImportPath && isVersionElement(elem) {
+ _, elem = pathpkg.Split(pathpkg.Dir(p.ImportPath))
}
}
return elem
}
+// exeFromFiles returns an executable name for a package
+// using the first element in GoFiles or CgoFiles collections without the prefix.
+//
+// Returns empty string in case of empty collection.
+func (p *Package) exeFromFiles() string {
+ var src string
+ if len(p.GoFiles) > 0 {
+ src = p.GoFiles[0]
+ } else if len(p.CgoFiles) > 0 {
+ src = p.CgoFiles[0]
+ } else {
+ return ""
+ }
+ _, elem := filepath.Split(src)
+ return elem[:len(elem)-len(".go")]
+}
+
+// DefaultExecName returns the default executable name for a package
+func (p *Package) DefaultExecName() string {
+ if p.Internal.CmdlineFiles {
+ return p.exeFromFiles()
+ }
+ return p.exeFromImportPath()
+}
+
// load populates p using information from bp, err, which should
// be the result of calling build.Context.Import.
func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
@@ -1428,17 +1526,30 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
p.Internal.LocalPrefix = dirToImportPath(p.Dir)
}
+ // setError sets p.Error if it hasn't already been set. We may proceed
+ // after encountering some errors so that 'go list -e' has more complete
+ // output. If there's more than one error, we should report the first.
+ setError := func(err error) {
+ if p.Error == nil {
+ p.Error = &PackageError{
+ ImportStack: stk.Copy(),
+ Err: err,
+ }
+ }
+ }
+
if err != nil {
if _, ok := err.(*build.NoGoError); ok {
err = &NoGoError{Package: p}
}
p.Incomplete = true
- err = base.ExpandScanner(err)
- p.Error = &PackageError{
- ImportStack: stk.Copy(),
- Err: err.Error(),
+
+ setError(base.ExpandScanner(err))
+ if _, isScanErr := err.(scanner.ErrorList); !isScanErr {
+ return
}
- return
+ // Fall through if there was an error parsing a file. 'go list -e' should
+ // still report imports and other metadata.
}
useBindir := p.Name == "main"
@@ -1453,11 +1564,11 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
// Report an error when the old code.google.com/p/go.tools paths are used.
if InstallTargetDir(p) == StalePath {
newPath := strings.Replace(p.ImportPath, "code.google.com/p/go.", "golang.org/x/", 1)
- e := fmt.Sprintf("the %v command has moved; use %v instead.", p.ImportPath, newPath)
- p.Error = &PackageError{Err: e}
+ e := ImportErrorf(p.ImportPath, "the %v command has moved; use %v instead.", p.ImportPath, newPath)
+ setError(e)
return
}
- elem := DefaultExecName(p.ImportPath)
+ elem := p.DefaultExecName()
full := cfg.BuildContext.GOOS + "_" + cfg.BuildContext.GOARCH + "/" + elem
if cfg.BuildContext.GOOS != base.ToolGOOS || cfg.BuildContext.GOARCH != base.ToolGOARCH {
// Install cross-compiled binaries to subdirectories of bin.
@@ -1493,7 +1604,10 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
p.Target = ""
} else {
p.Target = p.Internal.Build.PkgObj
- if cfg.BuildLinkshared {
+ if cfg.BuildLinkshared && p.Target != "" {
+ // TODO(bcmills): The reliance on p.Target implies that -linkshared does
+ // not work for any package that lacks a Target — such as a non-main
+ // package in module mode. We should probably fix that.
shlibnamefile := p.Target[:len(p.Target)-2] + ".shlibname"
shlib, err := ioutil.ReadFile(shlibnamefile)
if err != nil && !os.IsNotExist(err) {
@@ -1564,10 +1678,7 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
inputs := p.AllFiles()
f1, f2 := str.FoldDup(inputs)
if f1 != "" {
- p.Error = &PackageError{
- ImportStack: stk.Copy(),
- Err: fmt.Sprintf("case-insensitive file name collision: %q and %q", f1, f2),
- }
+ setError(fmt.Errorf("case-insensitive file name collision: %q and %q", f1, f2))
return
}
@@ -1580,25 +1691,16 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
// so we shouldn't see any _cgo_ files anyway, but just be safe.
for _, file := range inputs {
if !SafeArg(file) || strings.HasPrefix(file, "_cgo_") {
- p.Error = &PackageError{
- ImportStack: stk.Copy(),
- Err: fmt.Sprintf("invalid input file name %q", file),
- }
+ setError(fmt.Errorf("invalid input file name %q", file))
return
}
}
if name := pathpkg.Base(p.ImportPath); !SafeArg(name) {
- p.Error = &PackageError{
- ImportStack: stk.Copy(),
- Err: fmt.Sprintf("invalid input directory name %q", name),
- }
+ setError(fmt.Errorf("invalid input directory name %q", name))
return
}
if !SafeArg(p.ImportPath) {
- p.Error = &PackageError{
- ImportStack: stk.Copy(),
- Err: fmt.Sprintf("invalid import path %q", p.ImportPath),
- }
+ setError(ImportErrorf(p.ImportPath, "invalid import path %q", p.ImportPath))
return
}
@@ -1643,31 +1745,24 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
// code; see issue #16050).
}
- setError := func(msg string) {
- p.Error = &PackageError{
- ImportStack: stk.Copy(),
- Err: msg,
- }
- }
-
// The gc toolchain only permits C source files with cgo or SWIG.
if len(p.CFiles) > 0 && !p.UsesCgo() && !p.UsesSwig() && cfg.BuildContext.Compiler == "gc" {
- setError(fmt.Sprintf("C source files not allowed when not using cgo or SWIG: %s", strings.Join(p.CFiles, " ")))
+ setError(fmt.Errorf("C source files not allowed when not using cgo or SWIG: %s", strings.Join(p.CFiles, " ")))
return
}
// C++, Objective-C, and Fortran source files are permitted only with cgo or SWIG,
// regardless of toolchain.
if len(p.CXXFiles) > 0 && !p.UsesCgo() && !p.UsesSwig() {
- setError(fmt.Sprintf("C++ source files not allowed when not using cgo or SWIG: %s", strings.Join(p.CXXFiles, " ")))
+ setError(fmt.Errorf("C++ source files not allowed when not using cgo or SWIG: %s", strings.Join(p.CXXFiles, " ")))
return
}
if len(p.MFiles) > 0 && !p.UsesCgo() && !p.UsesSwig() {
- setError(fmt.Sprintf("Objective-C source files not allowed when not using cgo or SWIG: %s", strings.Join(p.MFiles, " ")))
+ setError(fmt.Errorf("Objective-C source files not allowed when not using cgo or SWIG: %s", strings.Join(p.MFiles, " ")))
return
}
if len(p.FFiles) > 0 && !p.UsesCgo() && !p.UsesSwig() {
- setError(fmt.Sprintf("Fortran source files not allowed when not using cgo or SWIG: %s", strings.Join(p.FFiles, " ")))
+ setError(fmt.Errorf("Fortran source files not allowed when not using cgo or SWIG: %s", strings.Join(p.FFiles, " ")))
return
}
@@ -1676,17 +1771,17 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
if other := foldPath[fold]; other == "" {
foldPath[fold] = p.ImportPath
} else if other != p.ImportPath {
- setError(fmt.Sprintf("case-insensitive import collision: %q and %q", p.ImportPath, other))
+ setError(ImportErrorf(p.ImportPath, "case-insensitive import collision: %q and %q", p.ImportPath, other))
return
}
- if cfg.ModulesEnabled {
+ if cfg.ModulesEnabled && p.Error == nil {
mainPath := p.ImportPath
if p.Internal.CmdlineFiles {
mainPath = "command-line-arguments"
}
p.Module = ModPackageModuleInfo(mainPath)
- if p.Name == "main" {
+ if p.Name == "main" && len(p.DepsErrors) == 0 {
p.Internal.BuildInfo = ModPackageBuildInfo(mainPath, p.Deps)
}
}
@@ -1956,9 +2051,14 @@ func Packages(args []string) []*Package {
// cannot be loaded at all.
// The packages that fail to load will have p.Error != nil.
func PackagesAndErrors(patterns []string) []*Package {
- if len(patterns) > 0 {
- for _, p := range patterns {
- if strings.HasSuffix(p, ".go") {
+ for _, p := range patterns {
+ // Listing is only supported with all patterns referring to either:
+ // - Files that are part of the same directory.
+ // - Explicit package paths or patterns.
+ if strings.HasSuffix(p, ".go") {
+ // We need to test whether the path is an actual Go file and not a
+ // package path or pattern ending in '.go' (see golang.org/issue/34653).
+ if fi, err := os.Stat(p); err == nil && !fi.IsDir() {
return []*Package{GoFilesPackage(patterns)}
}
}
@@ -2078,7 +2178,7 @@ func GoFilesPackage(gofiles []string) *Package {
pkg.Internal.CmdlineFiles = true
pkg.Name = f
pkg.Error = &PackageError{
- Err: fmt.Sprintf("named files must be .go files: %s", pkg.Name),
+ Err: fmt.Errorf("named files must be .go files: %s", pkg.Name),
}
return pkg
}
@@ -2141,11 +2241,8 @@ func GoFilesPackage(gofiles []string) *Package {
pkg.Match = gofiles
if pkg.Name == "main" {
- _, elem := filepath.Split(gofiles[0])
- exe := elem[:len(elem)-len(".go")] + cfg.ExeSuffix
- if cfg.BuildO == "" {
- cfg.BuildO = exe
- }
+ exe := pkg.DefaultExecName() + cfg.ExeSuffix
+
if cfg.GOBIN != "" {
pkg.Target = filepath.Join(cfg.GOBIN, exe)
} else if cfg.ModulesEnabled {
diff --git a/libgo/go/cmd/go/internal/load/pkg_test.go b/libgo/go/cmd/go/internal/load/pkg_test.go
index 9ddc20d0500..1e59fb989c5 100644
--- a/libgo/go/cmd/go/internal/load/pkg_test.go
+++ b/libgo/go/cmd/go/internal/load/pkg_test.go
@@ -5,39 +5,49 @@ import (
"testing"
)
-func TestDefaultExecName(t *testing.T) {
+func TestPkgDefaultExecName(t *testing.T) {
oldModulesEnabled := cfg.ModulesEnabled
defer func() { cfg.ModulesEnabled = oldModulesEnabled }()
for _, tt := range []struct {
in string
+ files []string
wantMod string
wantGopath string
}{
- {"example.com/mycmd", "mycmd", "mycmd"},
- {"example.com/mycmd/v0", "v0", "v0"},
- {"example.com/mycmd/v1", "v1", "v1"},
- {"example.com/mycmd/v2", "mycmd", "v2"}, // Semantic import versioning, use second last element in module mode.
- {"example.com/mycmd/v3", "mycmd", "v3"}, // Semantic import versioning, use second last element in module mode.
- {"mycmd", "mycmd", "mycmd"},
- {"mycmd/v0", "v0", "v0"},
- {"mycmd/v1", "v1", "v1"},
- {"mycmd/v2", "mycmd", "v2"}, // Semantic import versioning, use second last element in module mode.
- {"v0", "v0", "v0"},
- {"v1", "v1", "v1"},
- {"v2", "v2", "v2"},
+ {"example.com/mycmd", []string{}, "mycmd", "mycmd"},
+ {"example.com/mycmd/v0", []string{}, "v0", "v0"},
+ {"example.com/mycmd/v1", []string{}, "v1", "v1"},
+ {"example.com/mycmd/v2", []string{}, "mycmd", "v2"}, // Semantic import versioning, use second last element in module mode.
+ {"example.com/mycmd/v3", []string{}, "mycmd", "v3"}, // Semantic import versioning, use second last element in module mode.
+ {"mycmd", []string{}, "mycmd", "mycmd"},
+ {"mycmd/v0", []string{}, "v0", "v0"},
+ {"mycmd/v1", []string{}, "v1", "v1"},
+ {"mycmd/v2", []string{}, "mycmd", "v2"}, // Semantic import versioning, use second last element in module mode.
+ {"v0", []string{}, "v0", "v0"},
+ {"v1", []string{}, "v1", "v1"},
+ {"v2", []string{}, "v2", "v2"},
+ {"command-line-arguments", []string{"output.go", "foo.go"}, "output", "output"},
} {
{
cfg.ModulesEnabled = true
- gotMod := DefaultExecName(tt.in)
+ pkg := new(Package)
+ pkg.ImportPath = tt.in
+ pkg.GoFiles = tt.files
+ pkg.Internal.CmdlineFiles = len(tt.files) > 0
+ gotMod := pkg.DefaultExecName()
if gotMod != tt.wantMod {
- t.Errorf("DefaultExecName(%q) in module mode = %v; want %v", tt.in, gotMod, tt.wantMod)
+ t.Errorf("pkg.DefaultExecName with ImportPath = %q in module mode = %v; want %v", tt.in, gotMod, tt.wantMod)
}
}
{
cfg.ModulesEnabled = false
- gotGopath := DefaultExecName(tt.in)
+ pkg := new(Package)
+ pkg.ImportPath = tt.in
+ pkg.GoFiles = tt.files
+ pkg.Internal.CmdlineFiles = len(tt.files) > 0
+ gotGopath := pkg.DefaultExecName()
if gotGopath != tt.wantGopath {
- t.Errorf("DefaultExecName(%q) in gopath mode = %v; want %v", tt.in, gotGopath, tt.wantGopath)
+ t.Errorf("pkg.DefaultExecName with ImportPath = %q in gopath mode = %v; want %v", tt.in, gotGopath, tt.wantGopath)
}
}
}
diff --git a/libgo/go/cmd/go/internal/load/test.go b/libgo/go/cmd/go/internal/load/test.go
index afff5deaaa9..fefc7d2e307 100644
--- a/libgo/go/cmd/go/internal/load/test.go
+++ b/libgo/go/cmd/go/internal/load/test.go
@@ -110,7 +110,7 @@ func TestPackagesAndErrors(p *Package, cover *TestCover) (pmain, ptest, pxtest *
// non-test copy of a package.
ptestErr = &PackageError{
ImportStack: testImportStack(stk[0], p1, p.ImportPath),
- Err: "import cycle not allowed in test",
+ Err: errors.New("import cycle not allowed in test"),
IsImportCycle: true,
}
}
@@ -271,7 +271,7 @@ func TestPackagesAndErrors(p *Package, cover *TestCover) (pmain, ptest, pxtest *
// afterward that gathers t.Cover information.
t, err := loadTestFuncs(ptest)
if err != nil && pmain.Error == nil {
- pmain.Error = &PackageError{Err: err.Error()}
+ pmain.Error = &PackageError{Err: err}
}
t.Cover = cover
if len(ptest.GoFiles)+len(ptest.CgoFiles) > 0 {
@@ -322,7 +322,7 @@ func TestPackagesAndErrors(p *Package, cover *TestCover) (pmain, ptest, pxtest *
data, err := formatTestmain(t)
if err != nil && pmain.Error == nil {
- pmain.Error = &PackageError{Err: err.Error()}
+ pmain.Error = &PackageError{Err: err}
}
if data != nil {
pmain.Internal.TestmainGo = &data
@@ -399,10 +399,13 @@ func recompileForTest(pmain, preal, ptest, pxtest *Package) {
}
}
- // Don't compile build info from a main package. This can happen
- // if -coverpkg patterns include main packages, since those packages
- // are imported by pmain. See golang.org/issue/30907.
- if p.Internal.BuildInfo != "" && p != pmain {
+ // Force main packages the test imports to be built as libraries.
+ // Normal imports of main packages are forbidden by the package loader,
+ // but this can still happen if -coverpkg patterns include main packages:
+ // covered packages are imported by pmain. Linking multiple packages
+ // compiled with '-p main' causes duplicate symbol errors.
+ // See golang.org/issue/30907, golang.org/issue/34114.
+ if p.Name == "main" && p != pmain && p != ptest {
split()
}
}
diff --git a/libgo/go/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go b/libgo/go/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go
index 581a978ef8e..faf73446f79 100644
--- a/libgo/go/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go
+++ b/libgo/go/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !js,!nacl,!plan9
+// +build !js,!plan9
package filelock_test
diff --git a/libgo/go/cmd/go/internal/lockedfile/lockedfile.go b/libgo/go/cmd/go/internal/lockedfile/lockedfile.go
index bb184b1085e..59b2dba44cd 100644
--- a/libgo/go/cmd/go/internal/lockedfile/lockedfile.go
+++ b/libgo/go/cmd/go/internal/lockedfile/lockedfile.go
@@ -120,3 +120,68 @@ func Write(name string, content io.Reader, perm os.FileMode) (err error) {
}
return err
}
+
+// Transform invokes t with the result of reading the named file, with its lock
+// still held.
+//
+// If t returns a nil error, Transform then writes the returned contents back to
+// the file, making a best effort to preserve existing contents on error.
+//
+// t must not modify the slice passed to it.
+func Transform(name string, t func([]byte) ([]byte, error)) (err error) {
+ f, err := Edit(name)
+ if err != nil {
+ return err
+ }
+ defer f.Close()
+
+ old, err := ioutil.ReadAll(f)
+ if err != nil {
+ return err
+ }
+
+ new, err := t(old)
+ if err != nil {
+ return err
+ }
+
+ if len(new) > len(old) {
+ // The overall file size is increasing, so write the tail first: if we're
+ // about to run out of space on the disk, we would rather detect that
+ // failure before we have overwritten the original contents.
+ if _, err := f.WriteAt(new[len(old):], int64(len(old))); err != nil {
+ // Make a best effort to remove the incomplete tail.
+ f.Truncate(int64(len(old)))
+ return err
+ }
+ }
+
+ // We're about to overwrite the old contents. In case of failure, make a best
+ // effort to roll back before we close the file.
+ defer func() {
+ if err != nil {
+ if _, err := f.WriteAt(old, 0); err == nil {
+ f.Truncate(int64(len(old)))
+ }
+ }
+ }()
+
+ if len(new) >= len(old) {
+ if _, err := f.WriteAt(new[:len(old)], 0); err != nil {
+ return err
+ }
+ } else {
+ if _, err := f.WriteAt(new, 0); err != nil {
+ return err
+ }
+ // The overall file size is decreasing, so shrink the file to its final size
+ // after writing. We do this after writing (instead of before) so that if
+ // the write fails, enough filesystem space will likely still be reserved
+ // to contain the previous contents.
+ if err := f.Truncate(int64(len(new))); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
diff --git a/libgo/go/cmd/go/internal/lockedfile/lockedfile_test.go b/libgo/go/cmd/go/internal/lockedfile/lockedfile_test.go
index 6d5819efdb0..8f7a7d5604a 100644
--- a/libgo/go/cmd/go/internal/lockedfile/lockedfile_test.go
+++ b/libgo/go/cmd/go/internal/lockedfile/lockedfile_test.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// js and nacl do not support inter-process file locking.
-// +build !js,!nacl
+// js does not support inter-process file locking.
+// +build !js
package lockedfile_test
diff --git a/libgo/go/cmd/go/internal/lockedfile/transform_test.go b/libgo/go/cmd/go/internal/lockedfile/transform_test.go
new file mode 100644
index 00000000000..407d48ea4a3
--- /dev/null
+++ b/libgo/go/cmd/go/internal/lockedfile/transform_test.go
@@ -0,0 +1,104 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// js does not support inter-process file locking.
+// +build !js
+
+package lockedfile_test
+
+import (
+ "bytes"
+ "encoding/binary"
+ "math/rand"
+ "path/filepath"
+ "testing"
+ "time"
+
+ "cmd/go/internal/lockedfile"
+)
+
+func isPowerOf2(x int) bool {
+ return x > 0 && x&(x-1) == 0
+}
+
+func roundDownToPowerOf2(x int) int {
+ if x <= 0 {
+ panic("nonpositive x")
+ }
+ bit := 1
+ for x != bit {
+ x = x &^ bit
+ bit <<= 1
+ }
+ return x
+}
+
+func TestTransform(t *testing.T) {
+ dir, remove := mustTempDir(t)
+ defer remove()
+ path := filepath.Join(dir, "blob.bin")
+
+ const maxChunkWords = 8 << 10
+ buf := make([]byte, 2*maxChunkWords*8)
+ for i := uint64(0); i < 2*maxChunkWords; i++ {
+ binary.LittleEndian.PutUint64(buf[i*8:], i)
+ }
+ if err := lockedfile.Write(path, bytes.NewReader(buf[:8]), 0666); err != nil {
+ t.Fatal(err)
+ }
+
+ var attempts int64 = 128
+ if !testing.Short() {
+ attempts *= 16
+ }
+ const parallel = 32
+
+ var sem = make(chan bool, parallel)
+
+ for n := attempts; n > 0; n-- {
+ sem <- true
+ go func() {
+ defer func() { <-sem }()
+
+ time.Sleep(time.Duration(rand.Intn(100)) * time.Microsecond)
+ chunkWords := roundDownToPowerOf2(rand.Intn(maxChunkWords) + 1)
+ offset := rand.Intn(chunkWords)
+
+ err := lockedfile.Transform(path, func(data []byte) (chunk []byte, err error) {
+ chunk = buf[offset*8 : (offset+chunkWords)*8]
+
+ if len(data)&^7 != len(data) {
+ t.Errorf("read %d bytes, but each write is an integer multiple of 8 bytes", len(data))
+ return chunk, nil
+ }
+
+ words := len(data) / 8
+ if !isPowerOf2(words) {
+ t.Errorf("read %d 8-byte words, but each write is a power-of-2 number of words", words)
+ return chunk, nil
+ }
+
+ u := binary.LittleEndian.Uint64(data)
+ for i := 1; i < words; i++ {
+ next := binary.LittleEndian.Uint64(data[i*8:])
+ if next != u+1 {
+ t.Errorf("wrote sequential integers, but read integer out of sequence at offset %d", i)
+ return chunk, nil
+ }
+ u = next
+ }
+
+ return chunk, nil
+ })
+
+ if err != nil {
+ t.Errorf("unexpected error from Transform: %v", err)
+ }
+ }()
+ }
+
+ for n := parallel; n > 0; n-- {
+ sem <- true
+ }
+}
diff --git a/libgo/go/cmd/go/internal/modcmd/download.go b/libgo/go/cmd/go/internal/modcmd/download.go
index 60d0d5b6e2b..5db0e46c644 100644
--- a/libgo/go/cmd/go/internal/modcmd/download.go
+++ b/libgo/go/cmd/go/internal/modcmd/download.go
@@ -5,19 +5,21 @@
package modcmd
import (
- "cmd/go/internal/cfg"
"encoding/json"
"os"
"cmd/go/internal/base"
+ "cmd/go/internal/cfg"
"cmd/go/internal/modfetch"
"cmd/go/internal/modload"
- "cmd/go/internal/module"
"cmd/go/internal/par"
+ "cmd/go/internal/work"
+
+ "golang.org/x/mod/module"
)
var cmdDownload = &base.Command{
- UsageLine: "go mod download [-json] [modules]",
+ UsageLine: "go mod download [-x] [-json] [modules]",
Short: "download modules to local cache",
Long: `
Download downloads the named modules, which can be module patterns selecting
@@ -43,9 +45,10 @@ corresponding to this Go struct:
Dir string // absolute path to cached source root directory
Sum string // checksum for path, version (as in go.sum)
GoModSum string // checksum for go.mod (as in go.sum)
- Latest bool // would @latest resolve to this version?
}
+The -x flag causes download to print the commands download executes.
+
See 'go help modules' for more about module queries.
`,
}
@@ -54,6 +57,10 @@ var downloadJSON = cmdDownload.Flag.Bool("json", false, "")
func init() {
cmdDownload.Run = runDownload // break init cycle
+
+ // TODO(jayconrod): https://golang.org/issue/35849 Apply -x to other 'go mod' commands.
+ cmdDownload.Flag.BoolVar(&cfg.BuildX, "x", false, "")
+ work.AddModCommonFlags(cmdDownload)
}
type moduleJSON struct {
@@ -66,7 +73,6 @@ type moduleJSON struct {
Dir string `json:",omitempty"`
Sum string `json:",omitempty"`
GoModSum string `json:",omitempty"`
- Latest bool `json:",omitempty"`
}
func runDownload(cmd *base.Command, args []string) {
@@ -79,6 +85,17 @@ func runDownload(cmd *base.Command, args []string) {
}
if len(args) == 0 {
args = []string{"all"}
+ } else if modload.HasModRoot() {
+ modload.InitMod() // to fill Target
+ targetAtLatest := modload.Target.Path + "@latest"
+ targetAtUpgrade := modload.Target.Path + "@upgrade"
+ targetAtPatch := modload.Target.Path + "@patch"
+ for _, arg := range args {
+ switch arg {
+ case modload.Target.Path, targetAtLatest, targetAtUpgrade, targetAtPatch:
+ os.Stderr.WriteString("go mod download: skipping argument " + arg + " that resolves to the main module\n")
+ }
+ }
}
var mods []*moduleJSON
@@ -90,7 +107,8 @@ func runDownload(cmd *base.Command, args []string) {
info = info.Replace
}
if info.Version == "" && info.Error == nil {
- // main module
+ // main module or module replaced with file path.
+ // Nothing to download.
continue
}
m := &moduleJSON{
@@ -105,31 +123,6 @@ func runDownload(cmd *base.Command, args []string) {
work.Add(m)
}
- latest := map[string]string{} // path → version
- if *downloadJSON {
- // We need to populate the Latest field, but if the main module depends on a
- // version newer than latest — or if the version requested on the command
- // line is itself newer than latest — that's not trivial to determine from
- // the info returned by ListModules. Instead, we issue a separate
- // ListModules request for "latest", which should be inexpensive relative to
- // downloading the modules.
- var latestArgs []string
- for _, m := range mods {
- if m.Error != "" {
- continue
- }
- latestArgs = append(latestArgs, m.Path+"@latest")
- }
-
- if len(latestArgs) > 0 {
- for _, info := range modload.ListModules(latestArgs, listU, listVersions) {
- if info.Version != "" {
- latest[info.Path] = info.Version
- }
- }
- }
- }
-
work.Do(10, func(item interface{}) {
m := item.(*moduleJSON)
var err error
@@ -160,9 +153,6 @@ func runDownload(cmd *base.Command, args []string) {
m.Error = err.Error()
return
}
- if latest[m.Path] == m.Version {
- m.Latest = true
- }
})
if *downloadJSON {
diff --git a/libgo/go/cmd/go/internal/modcmd/edit.go b/libgo/go/cmd/go/internal/modcmd/edit.go
index 1be8b7cb2fb..dbbfb96e42b 100644
--- a/libgo/go/cmd/go/internal/modcmd/edit.go
+++ b/libgo/go/cmd/go/internal/modcmd/edit.go
@@ -9,17 +9,19 @@ package modcmd
import (
"bytes"
"encoding/json"
+ "errors"
"fmt"
- "io/ioutil"
"os"
- "path/filepath"
"strings"
"cmd/go/internal/base"
+ "cmd/go/internal/lockedfile"
"cmd/go/internal/modfetch"
- "cmd/go/internal/modfile"
"cmd/go/internal/modload"
- "cmd/go/internal/module"
+ "cmd/go/internal/work"
+
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
)
var cmdEdit = &base.Command{
@@ -53,12 +55,17 @@ The -exclude=path@version and -dropexclude=path@version flags
add and drop an exclusion for the given module path and version.
Note that -exclude=path@version is a no-op if that exclusion already exists.
-The -replace=old[@v]=new[@v] and -dropreplace=old[@v] flags
-add and drop a replacement of the given module path and version pair.
-If the @v in old@v is omitted, the replacement applies to all versions
-with the old module path. If the @v in new@v is omitted, the new path
-should be a local module root directory, not a module path.
-Note that -replace overrides any existing replacements for old[@v].
+The -replace=old[@v]=new[@v] flag adds a replacement of the given
+module path and version pair. If the @v in old@v is omitted, a
+replacement without a version on the left side is added, which applies
+to all versions of the old module path. If the @v in new@v is omitted,
+the new path should be a local module root directory, not a module
+path. Note that -replace overrides any redundant replacements for old[@v],
+so omitting @v will drop existing replacements for specific versions.
+
+The -dropreplace=old[@v] flag drops a replacement of the given
+module path and version pair. If the @v is omitted, a replacement without
+a version on the left side is dropped.
The -require, -droprequire, -exclude, -dropexclude, -replace,
and -dropreplace editing flags may be repeated, and the changes
@@ -130,6 +137,7 @@ func init() {
cmdEdit.Flag.Var(flagFunc(flagReplace), "replace", "")
cmdEdit.Flag.Var(flagFunc(flagDropExclude), "dropexclude", "")
+ work.AddModCommonFlags(cmdEdit)
base.AddBuildFlagsNX(&cmdEdit.Flag)
}
@@ -157,11 +165,11 @@ func runEdit(cmd *base.Command, args []string) {
if len(args) == 1 {
gomod = args[0]
} else {
- gomod = filepath.Join(modload.ModRoot(), "go.mod")
+ gomod = modload.ModFilePath()
}
if *editModule != "" {
- if err := module.CheckPath(*editModule); err != nil {
+ if err := module.CheckImportPath(*editModule); err != nil {
base.Fatalf("go mod: invalid -module: %v", err)
}
}
@@ -172,7 +180,7 @@ func runEdit(cmd *base.Command, args []string) {
}
}
- data, err := ioutil.ReadFile(gomod)
+ data, err := lockedfile.Read(gomod)
if err != nil {
base.Fatalf("go: %v", err)
}
@@ -215,13 +223,19 @@ func runEdit(cmd *base.Command, args []string) {
return
}
- unlock := modfetch.SideLock()
- defer unlock()
- lockedData, err := ioutil.ReadFile(gomod)
- if err == nil && !bytes.Equal(lockedData, data) {
- base.Fatalf("go: go.mod changed during editing; not overwriting")
+ // Make a best-effort attempt to acquire the side lock, only to exclude
+ // previous versions of the 'go' command from making simultaneous edits.
+ if unlock, err := modfetch.SideLock(); err == nil {
+ defer unlock()
}
- if err := ioutil.WriteFile(gomod, out, 0666); err != nil {
+
+ err = lockedfile.Transform(gomod, func(lockedData []byte) ([]byte, error) {
+ if !bytes.Equal(lockedData, data) {
+ return nil, errors.New("go.mod changed during editing; not overwriting")
+ }
+ return out, nil
+ })
+ if err != nil {
base.Fatalf("go: %v", err)
}
}
@@ -233,7 +247,7 @@ func parsePathVersion(flag, arg string) (path, version string) {
base.Fatalf("go mod: -%s=%s: need path@version", flag, arg)
}
path, version = strings.TrimSpace(arg[:i]), strings.TrimSpace(arg[i+1:])
- if err := module.CheckPath(path); err != nil {
+ if err := module.CheckImportPath(path); err != nil {
base.Fatalf("go mod: -%s=%s: invalid path: %v", flag, arg, err)
}
@@ -255,7 +269,7 @@ func parsePath(flag, arg string) (path string) {
base.Fatalf("go mod: -%s=%s: need just path, not path@version", flag, arg)
}
path = arg
- if err := module.CheckPath(path); err != nil {
+ if err := module.CheckImportPath(path); err != nil {
base.Fatalf("go mod: -%s=%s: invalid path: %v", flag, arg, err)
}
return path
@@ -269,7 +283,7 @@ func parsePathVersionOptional(adj, arg string, allowDirPath bool) (path, version
} else {
path, version = strings.TrimSpace(arg[:i]), strings.TrimSpace(arg[i+1:])
}
- if err := module.CheckPath(path); err != nil {
+ if err := module.CheckImportPath(path); err != nil {
if !allowDirPath || !modfile.IsDirectoryPath(path) {
return path, version, fmt.Errorf("invalid %s path: %v", adj, err)
}
diff --git a/libgo/go/cmd/go/internal/modcmd/graph.go b/libgo/go/cmd/go/internal/modcmd/graph.go
index 8fcb84f2801..27ae9354f3d 100644
--- a/libgo/go/cmd/go/internal/modcmd/graph.go
+++ b/libgo/go/cmd/go/internal/modcmd/graph.go
@@ -8,14 +8,16 @@ package modcmd
import (
"bufio"
- "cmd/go/internal/cfg"
"os"
"sort"
"cmd/go/internal/base"
+ "cmd/go/internal/cfg"
"cmd/go/internal/modload"
- "cmd/go/internal/module"
"cmd/go/internal/par"
+ "cmd/go/internal/work"
+
+ "golang.org/x/mod/module"
)
var cmdGraph = &base.Command{
@@ -30,6 +32,10 @@ path@version, except for the main module, which has no @version suffix.
Run: runGraph,
}
+func init() {
+ work.AddModCommonFlags(cmdGraph)
+}
+
func runGraph(cmd *base.Command, args []string) {
if len(args) > 0 {
base.Fatalf("go mod graph: graph takes no arguments")
diff --git a/libgo/go/cmd/go/internal/modcmd/init.go b/libgo/go/cmd/go/internal/modcmd/init.go
index b94453bab0c..714ff2e205a 100644
--- a/libgo/go/cmd/go/internal/modcmd/init.go
+++ b/libgo/go/cmd/go/internal/modcmd/init.go
@@ -9,6 +9,7 @@ package modcmd
import (
"cmd/go/internal/base"
"cmd/go/internal/modload"
+ "cmd/go/internal/work"
"os"
"strings"
)
@@ -27,6 +28,10 @@ To override this guess, supply the module path as an argument.
Run: runInit,
}
+func init() {
+ work.AddModCommonFlags(cmdInit)
+}
+
func runInit(cmd *base.Command, args []string) {
modload.CmdModInit = true
if len(args) > 1 {
@@ -38,7 +43,8 @@ func runInit(cmd *base.Command, args []string) {
if os.Getenv("GO111MODULE") == "off" {
base.Fatalf("go mod init: modules disabled by GO111MODULE=off; see 'go help modules'")
}
- if _, err := os.Stat("go.mod"); err == nil {
+ modFilePath := modload.ModFilePath()
+ if _, err := os.Stat(modFilePath); err == nil {
base.Fatalf("go mod init: go.mod already exists")
}
if strings.Contains(modload.CmdModModule, "@") {
diff --git a/libgo/go/cmd/go/internal/modcmd/mod.go b/libgo/go/cmd/go/internal/modcmd/mod.go
index f150cc9728a..17505221587 100644
--- a/libgo/go/cmd/go/internal/modcmd/mod.go
+++ b/libgo/go/cmd/go/internal/modcmd/mod.go
@@ -5,7 +5,10 @@
// Package modcmd implements the ``go mod'' command.
package modcmd
-import "cmd/go/internal/base"
+import (
+ "cmd/go/internal/base"
+ "cmd/go/internal/cfg"
+)
var CmdMod = &base.Command{
UsageLine: "go mod",
@@ -29,3 +32,7 @@ See 'go help modules' for an overview of module functionality.
cmdWhy,
},
}
+
+func addModFlags(cmd *base.Command) {
+ cmd.Flag.StringVar(&cfg.ModFile, "modfile", "", "")
+}
diff --git a/libgo/go/cmd/go/internal/modcmd/tidy.go b/libgo/go/cmd/go/internal/modcmd/tidy.go
index 789e9366085..af2b04c0c20 100644
--- a/libgo/go/cmd/go/internal/modcmd/tidy.go
+++ b/libgo/go/cmd/go/internal/modcmd/tidy.go
@@ -7,14 +7,13 @@
package modcmd
import (
- "fmt"
- "os"
-
"cmd/go/internal/base"
"cmd/go/internal/cfg"
"cmd/go/internal/modfetch"
"cmd/go/internal/modload"
- "cmd/go/internal/module"
+ "cmd/go/internal/work"
+
+ "golang.org/x/mod/module"
)
var cmdTidy = &base.Command{
@@ -35,6 +34,7 @@ to standard error.
func init() {
cmdTidy.Run = runTidy // break init cycle
cmdTidy.Flag.BoolVar(&cfg.BuildV, "v", false, "")
+ work.AddModCommonFlags(cmdTidy)
}
func runTidy(cmd *base.Command, args []string) {
@@ -42,28 +42,8 @@ func runTidy(cmd *base.Command, args []string) {
base.Fatalf("go mod tidy: no arguments allowed")
}
- // LoadALL adds missing modules.
- // Remove unused modules.
- used := make(map[module.Version]bool)
- for _, pkg := range modload.LoadALL() {
- used[modload.PackageModule(pkg)] = true
- }
- used[modload.Target] = true // note: LoadALL initializes Target
-
- inGoMod := make(map[string]bool)
- for _, r := range modload.ModFile().Require {
- inGoMod[r.Mod.Path] = true
- }
-
- var keep []module.Version
- for _, m := range modload.BuildList() {
- if used[m] {
- keep = append(keep, m)
- } else if cfg.BuildV && inGoMod[m.Path] {
- fmt.Fprintf(os.Stderr, "unused %s\n", m.Path)
- }
- }
- modload.SetBuildList(keep)
+ modload.LoadALL()
+ modload.TidyBuildList()
modTidyGoSum() // updates memory copy; WriteGoMod on next line flushes it out
modload.WriteGoMod()
}
diff --git a/libgo/go/cmd/go/internal/modcmd/vendor.go b/libgo/go/cmd/go/internal/modcmd/vendor.go
index 75513f1d9ca..0c00d1222e0 100644
--- a/libgo/go/cmd/go/internal/modcmd/vendor.go
+++ b/libgo/go/cmd/go/internal/modcmd/vendor.go
@@ -18,7 +18,10 @@ import (
"cmd/go/internal/cfg"
"cmd/go/internal/imports"
"cmd/go/internal/modload"
- "cmd/go/internal/module"
+ "cmd/go/internal/work"
+
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
)
var cmdVendor = &base.Command{
@@ -37,6 +40,7 @@ modules and packages to standard error.
func init() {
cmdVendor.Flag.BoolVar(&cfg.BuildV, "v", false, "")
+ work.AddModCommonFlags(cmdVendor)
}
func runVendor(cmd *base.Command, args []string) {
@@ -59,19 +63,31 @@ func runVendor(cmd *base.Command, args []string) {
modpkgs[m] = append(modpkgs[m], pkg)
}
+ includeAllReplacements := false
+ isExplicit := map[module.Version]bool{}
+ if gv := modload.ModFile().Go; gv != nil && semver.Compare("v"+gv.Version, "v1.14") >= 0 {
+ // If the Go version is at least 1.14, annotate all explicit 'require' and
+ // 'replace' targets found in the go.mod file so that we can perform a
+ // stronger consistency check when -mod=vendor is set.
+ for _, r := range modload.ModFile().Require {
+ isExplicit[r.Mod] = true
+ }
+ includeAllReplacements = true
+ }
+
var buf bytes.Buffer
for _, m := range modload.BuildList()[1:] {
- if pkgs := modpkgs[m]; len(pkgs) > 0 {
- repl := ""
- if r := modload.Replacement(m); r.Path != "" {
- repl = " => " + r.Path
- if r.Version != "" {
- repl += " " + r.Version
- }
- }
- fmt.Fprintf(&buf, "# %s %s%s\n", m.Path, m.Version, repl)
+ if pkgs := modpkgs[m]; len(pkgs) > 0 || isExplicit[m] {
+ line := moduleLine(m, modload.Replacement(m))
+ buf.WriteString(line)
if cfg.BuildV {
- fmt.Fprintf(os.Stderr, "# %s %s%s\n", m.Path, m.Version, repl)
+ os.Stderr.WriteString(line)
+ }
+ if isExplicit[m] {
+ buf.WriteString("## explicit\n")
+ if cfg.BuildV {
+ os.Stderr.WriteString("## explicit\n")
+ }
}
sort.Strings(pkgs)
for _, pkg := range pkgs {
@@ -83,6 +99,26 @@ func runVendor(cmd *base.Command, args []string) {
}
}
}
+
+ if includeAllReplacements {
+ // Record unused and wildcard replacements at the end of the modules.txt file:
+ // without access to the complete build list, the consumer of the vendor
+ // directory can't otherwise determine that those replacements had no effect.
+ for _, r := range modload.ModFile().Replace {
+ if len(modpkgs[r.Old]) > 0 {
+ // We we already recorded this replacement in the entry for the replaced
+ // module with the packages it provides.
+ continue
+ }
+
+ line := moduleLine(r.Old, r.New)
+ buf.WriteString(line)
+ if cfg.BuildV {
+ os.Stderr.WriteString(line)
+ }
+ }
+ }
+
if buf.Len() == 0 {
fmt.Fprintf(os.Stderr, "go: no dependencies to vendor\n")
return
@@ -92,6 +128,26 @@ func runVendor(cmd *base.Command, args []string) {
}
}
+func moduleLine(m, r module.Version) string {
+ b := new(strings.Builder)
+ b.WriteString("# ")
+ b.WriteString(m.Path)
+ if m.Version != "" {
+ b.WriteString(" ")
+ b.WriteString(m.Version)
+ }
+ if r.Path != "" {
+ b.WriteString(" => ")
+ b.WriteString(r.Path)
+ if r.Version != "" {
+ b.WriteString(" ")
+ b.WriteString(r.Version)
+ }
+ }
+ b.WriteString("\n")
+ return b.String()
+}
+
func vendorPkg(vdir, pkg string) {
realPath := modload.ImportMap(pkg)
if realPath != pkg && modload.ImportMap(realPath) != "" {
diff --git a/libgo/go/cmd/go/internal/modcmd/verify.go b/libgo/go/cmd/go/internal/modcmd/verify.go
index 81fc44dc97a..831e5cf85bb 100644
--- a/libgo/go/cmd/go/internal/modcmd/verify.go
+++ b/libgo/go/cmd/go/internal/modcmd/verify.go
@@ -6,16 +6,18 @@ package modcmd
import (
"bytes"
- "cmd/go/internal/cfg"
"fmt"
"io/ioutil"
"os"
"cmd/go/internal/base"
- "cmd/go/internal/dirhash"
+ "cmd/go/internal/cfg"
"cmd/go/internal/modfetch"
"cmd/go/internal/modload"
- "cmd/go/internal/module"
+ "cmd/go/internal/work"
+
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/sumdb/dirhash"
)
var cmdVerify = &base.Command{
@@ -32,13 +34,17 @@ non-zero status.
Run: runVerify,
}
+func init() {
+ work.AddModCommonFlags(cmdVerify)
+}
+
func runVerify(cmd *base.Command, args []string) {
if len(args) != 0 {
// NOTE(rsc): Could take a module pattern.
base.Fatalf("go mod verify: verify takes no arguments")
}
// Checks go mod expected behavior
- if !modload.Enabled() {
+ if !modload.Enabled() || !modload.HasModRoot() {
if cfg.Getenv("GO111MODULE") == "off" {
base.Fatalf("go: modules disabled by GO111MODULE=off; see 'go help modules'")
} else {
diff --git a/libgo/go/cmd/go/internal/modcmd/why.go b/libgo/go/cmd/go/internal/modcmd/why.go
index 03e0a039bc5..40d238519b2 100644
--- a/libgo/go/cmd/go/internal/modcmd/why.go
+++ b/libgo/go/cmd/go/internal/modcmd/why.go
@@ -5,11 +5,14 @@
package modcmd
import (
- "cmd/go/internal/base"
- "cmd/go/internal/modload"
- "cmd/go/internal/module"
"fmt"
"strings"
+
+ "cmd/go/internal/base"
+ "cmd/go/internal/modload"
+ "cmd/go/internal/work"
+
+ "golang.org/x/mod/module"
)
var cmdWhy = &base.Command{
@@ -54,6 +57,7 @@ var (
func init() {
cmdWhy.Run = runWhy // break init cycle
+ work.AddModCommonFlags(cmdWhy)
}
func runWhy(cmd *base.Command, args []string) {
diff --git a/libgo/go/cmd/go/internal/modconv/convert.go b/libgo/go/cmd/go/internal/modconv/convert.go
index 558664a8b38..f465a9f395b 100644
--- a/libgo/go/cmd/go/internal/modconv/convert.go
+++ b/libgo/go/cmd/go/internal/modconv/convert.go
@@ -13,10 +13,11 @@ import (
"cmd/go/internal/base"
"cmd/go/internal/modfetch"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
"cmd/go/internal/par"
- "cmd/go/internal/semver"
+
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
)
// ConvertLegacyConfig converts legacy config to modfile.
diff --git a/libgo/go/cmd/go/internal/modconv/convert_test.go b/libgo/go/cmd/go/internal/modconv/convert_test.go
index 8ff229bd148..a2a26019677 100644
--- a/libgo/go/cmd/go/internal/modconv/convert_test.go
+++ b/libgo/go/cmd/go/internal/modconv/convert_test.go
@@ -19,8 +19,9 @@ import (
"cmd/go/internal/cfg"
"cmd/go/internal/modfetch"
"cmd/go/internal/modfetch/codehost"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
+
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
)
func TestMain(m *testing.M) {
diff --git a/libgo/go/cmd/go/internal/modconv/dep.go b/libgo/go/cmd/go/internal/modconv/dep.go
index ccd1fc7b759..2e673c3ab9f 100644
--- a/libgo/go/cmd/go/internal/modconv/dep.go
+++ b/libgo/go/cmd/go/internal/modconv/dep.go
@@ -12,9 +12,9 @@ import (
"strconv"
"strings"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
- "cmd/go/internal/semver"
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
)
func ParseGopkgLock(file string, data []byte) (*modfile.File, error) {
diff --git a/libgo/go/cmd/go/internal/modconv/glide.go b/libgo/go/cmd/go/internal/modconv/glide.go
index 18ab57814de..d1de3f7139d 100644
--- a/libgo/go/cmd/go/internal/modconv/glide.go
+++ b/libgo/go/cmd/go/internal/modconv/glide.go
@@ -7,8 +7,8 @@ package modconv
import (
"strings"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
)
func ParseGlideLock(file string, data []byte) (*modfile.File, error) {
diff --git a/libgo/go/cmd/go/internal/modconv/glock.go b/libgo/go/cmd/go/internal/modconv/glock.go
index 164a8e70d99..b8dc2046176 100644
--- a/libgo/go/cmd/go/internal/modconv/glock.go
+++ b/libgo/go/cmd/go/internal/modconv/glock.go
@@ -7,8 +7,8 @@ package modconv
import (
"strings"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
)
func ParseGLOCKFILE(file string, data []byte) (*modfile.File, error) {
diff --git a/libgo/go/cmd/go/internal/modconv/godeps.go b/libgo/go/cmd/go/internal/modconv/godeps.go
index 6398dbe7cd7..09c0fa3ddab 100644
--- a/libgo/go/cmd/go/internal/modconv/godeps.go
+++ b/libgo/go/cmd/go/internal/modconv/godeps.go
@@ -7,8 +7,8 @@ package modconv
import (
"encoding/json"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
)
func ParseGodepsJSON(file string, data []byte) (*modfile.File, error) {
diff --git a/libgo/go/cmd/go/internal/modconv/modconv.go b/libgo/go/cmd/go/internal/modconv/modconv.go
index a58673382e6..dc0607235f3 100644
--- a/libgo/go/cmd/go/internal/modconv/modconv.go
+++ b/libgo/go/cmd/go/internal/modconv/modconv.go
@@ -4,7 +4,7 @@
package modconv
-import "cmd/go/internal/modfile"
+import "golang.org/x/mod/modfile"
var Converters = map[string]func(string, []byte) (*modfile.File, error){
"GLOCKFILE": ParseGLOCKFILE,
diff --git a/libgo/go/cmd/go/internal/modconv/tsv.go b/libgo/go/cmd/go/internal/modconv/tsv.go
index 106cddedd39..4649579f650 100644
--- a/libgo/go/cmd/go/internal/modconv/tsv.go
+++ b/libgo/go/cmd/go/internal/modconv/tsv.go
@@ -7,8 +7,8 @@ package modconv
import (
"strings"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
)
func ParseDependenciesTSV(file string, data []byte) (*modfile.File, error) {
diff --git a/libgo/go/cmd/go/internal/modconv/vconf.go b/libgo/go/cmd/go/internal/modconv/vconf.go
index f62eba77621..9bad2baf8fb 100644
--- a/libgo/go/cmd/go/internal/modconv/vconf.go
+++ b/libgo/go/cmd/go/internal/modconv/vconf.go
@@ -7,8 +7,8 @@ package modconv
import (
"strings"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
)
func ParseVendorConf(file string, data []byte) (*modfile.File, error) {
diff --git a/libgo/go/cmd/go/internal/modconv/vjson.go b/libgo/go/cmd/go/internal/modconv/vjson.go
index eec86b73398..1bd025c980f 100644
--- a/libgo/go/cmd/go/internal/modconv/vjson.go
+++ b/libgo/go/cmd/go/internal/modconv/vjson.go
@@ -7,8 +7,8 @@ package modconv
import (
"encoding/json"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
)
func ParseVendorJSON(file string, data []byte) (*modfile.File, error) {
diff --git a/libgo/go/cmd/go/internal/modconv/vmanifest.go b/libgo/go/cmd/go/internal/modconv/vmanifest.go
index c0ef2a98622..bcf00083a52 100644
--- a/libgo/go/cmd/go/internal/modconv/vmanifest.go
+++ b/libgo/go/cmd/go/internal/modconv/vmanifest.go
@@ -7,8 +7,8 @@ package modconv
import (
"encoding/json"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
)
func ParseVendorManifest(file string, data []byte) (*modfile.File, error) {
diff --git a/libgo/go/cmd/go/internal/modconv/vyml.go b/libgo/go/cmd/go/internal/modconv/vyml.go
index 8a06519932c..cfa41941d55 100644
--- a/libgo/go/cmd/go/internal/modconv/vyml.go
+++ b/libgo/go/cmd/go/internal/modconv/vyml.go
@@ -7,8 +7,8 @@ package modconv
import (
"strings"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
)
func ParseVendorYML(file string, data []byte) (*modfile.File, error) {
diff --git a/libgo/go/cmd/go/internal/modfetch/bootstrap.go b/libgo/go/cmd/go/internal/modfetch/bootstrap.go
index 8f31589ebfc..e4020b0b41e 100644
--- a/libgo/go/cmd/go/internal/modfetch/bootstrap.go
+++ b/libgo/go/cmd/go/internal/modfetch/bootstrap.go
@@ -6,7 +6,7 @@
package modfetch
-import "cmd/go/internal/module"
+import "golang.org/x/mod/module"
func useSumDB(mod module.Version) bool {
return false
diff --git a/libgo/go/cmd/go/internal/modfetch/cache.go b/libgo/go/cmd/go/internal/modfetch/cache.go
index c0062809d17..104fce86dda 100644
--- a/libgo/go/cmd/go/internal/modfetch/cache.go
+++ b/libgo/go/cmd/go/internal/modfetch/cache.go
@@ -13,26 +13,28 @@ import (
"os"
"path/filepath"
"strings"
+ "time"
"cmd/go/internal/base"
"cmd/go/internal/cfg"
"cmd/go/internal/lockedfile"
"cmd/go/internal/modfetch/codehost"
- "cmd/go/internal/module"
"cmd/go/internal/par"
"cmd/go/internal/renameio"
- "cmd/go/internal/semver"
-)
-var QuietLookup bool // do not print about lookups
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
+)
var PkgMod string // $GOPATH/pkg/mod; set by package modload
+const logFindingDelay = 1 * time.Second
+
func cacheDir(path string) (string, error) {
if PkgMod == "" {
return "", fmt.Errorf("internal error: modfetch.PkgMod not set")
}
- enc, err := module.EncodePath(path)
+ enc, err := module.EscapePath(path)
if err != nil {
return "", err
}
@@ -50,7 +52,7 @@ func CachePath(m module.Version, suffix string) (string, error) {
if module.CanonicalVersion(m.Version) != m.Version {
return "", fmt.Errorf("non-canonical module version %q", m.Version)
}
- encVer, err := module.EncodeVersion(m.Version)
+ encVer, err := module.EscapeVersion(m.Version)
if err != nil {
return "", err
}
@@ -63,7 +65,7 @@ func DownloadDir(m module.Version) (string, error) {
if PkgMod == "" {
return "", fmt.Errorf("internal error: modfetch.PkgMod not set")
}
- enc, err := module.EncodePath(m.Path)
+ enc, err := module.EscapePath(m.Path)
if err != nil {
return "", err
}
@@ -73,7 +75,7 @@ func DownloadDir(m module.Version) (string, error) {
if module.CanonicalVersion(m.Version) != m.Version {
return "", fmt.Errorf("non-canonical module version %q", m.Version)
}
- encVer, err := module.EncodeVersion(m.Version)
+ encVer, err := module.EscapeVersion(m.Version)
if err != nil {
return "", err
}
@@ -93,22 +95,21 @@ func lockVersion(mod module.Version) (unlock func(), err error) {
return lockedfile.MutexAt(path).Lock()
}
-// SideLock locks a file within the module cache that that guards edits to files
-// outside the cache, such as go.sum and go.mod files in the user's working
-// directory. It returns a function that must be called to unlock the file.
-func SideLock() (unlock func()) {
+// SideLock locks a file within the module cache that that previously guarded
+// edits to files outside the cache, such as go.sum and go.mod files in the
+// user's working directory.
+// If err is nil, the caller MUST eventually call the unlock function.
+func SideLock() (unlock func(), err error) {
if PkgMod == "" {
base.Fatalf("go: internal error: modfetch.PkgMod not set")
}
+
path := filepath.Join(PkgMod, "cache", "lock")
if err := os.MkdirAll(filepath.Dir(path), 0777); err != nil {
- base.Fatalf("go: failed to create cache directory %s: %v", filepath.Dir(path), err)
+ return nil, fmt.Errorf("failed to create cache directory: %w", err)
}
- unlock, err := lockedfile.MutexAt(path).Lock()
- if err != nil {
- base.Fatalf("go: failed to lock file at %v", path)
- }
- return unlock
+
+ return lockedfile.MutexAt(path).Lock()
}
// A cachingRepo is a cache around an underlying Repo,
@@ -139,6 +140,11 @@ func (r *cachingRepo) Versions(prefix string) ([]string, error) {
err error
}
c := r.cache.Do("versions:"+prefix, func() interface{} {
+ logTimer := time.AfterFunc(logFindingDelay, func() {
+ fmt.Fprintf(os.Stderr, "go: finding versions for %s\n", r.path)
+ })
+ defer logTimer.Stop()
+
list, err := r.r.Versions(prefix)
return cached{list, err}
}).(cached)
@@ -161,9 +167,11 @@ func (r *cachingRepo) Stat(rev string) (*RevInfo, error) {
return cachedInfo{info, nil}
}
- if !QuietLookup {
+ logTimer := time.AfterFunc(logFindingDelay, func() {
fmt.Fprintf(os.Stderr, "go: finding %s %s\n", r.path, rev)
- }
+ })
+ defer logTimer.Stop()
+
info, err = r.r.Stat(rev)
if err == nil {
// If we resolved, say, 1234abcde to v0.0.0-20180604122334-1234abcdef78,
@@ -191,9 +199,11 @@ func (r *cachingRepo) Stat(rev string) (*RevInfo, error) {
func (r *cachingRepo) Latest() (*RevInfo, error) {
c := r.cache.Do("latest:", func() interface{} {
- if !QuietLookup {
+ logTimer := time.AfterFunc(logFindingDelay, func() {
fmt.Fprintf(os.Stderr, "go: finding %s latest\n", r.path)
- }
+ })
+ defer logTimer.Stop()
+
info, err := r.r.Latest()
// Save info for likely future Stat call.
@@ -230,7 +240,9 @@ func (r *cachingRepo) GoMod(version string) ([]byte, error) {
text, err = r.r.GoMod(version)
if err == nil {
- checkGoMod(r.path, version, text)
+ if err := checkGoMod(r.path, version, text); err != nil {
+ return cached{text, err}
+ }
if err := writeDiskGoMod(file, text); err != nil {
fmt.Fprintf(os.Stderr, "go: writing go.mod cache: %v\n", err)
}
@@ -490,7 +502,9 @@ func readDiskGoMod(path, rev string) (file string, data []byte, err error) {
}
if err == nil {
- checkGoMod(path, rev, data)
+ if err := checkGoMod(path, rev, data); err != nil {
+ return "", nil, err
+ }
}
return file, data, err
diff --git a/libgo/go/cmd/go/internal/modfetch/codehost/codehost.go b/libgo/go/cmd/go/internal/modfetch/codehost/codehost.go
index a4e50d692a3..5867288c966 100644
--- a/libgo/go/cmd/go/internal/modfetch/codehost/codehost.go
+++ b/libgo/go/cmd/go/internal/modfetch/codehost/codehost.go
@@ -73,11 +73,10 @@ type Repo interface {
// ReadZip downloads a zip file for the subdir subdirectory
// of the given revision to a new file in a given temporary directory.
// It should refuse to read more than maxSize bytes.
- // It returns a ReadCloser for a streamed copy of the zip file,
- // along with the actual subdirectory (possibly shorter than subdir)
- // contained in the zip file. All files in the zip file are expected to be
+ // It returns a ReadCloser for a streamed copy of the zip file.
+ // All files in the zip file are expected to be
// nested in a single top-level directory, whose name is not specified.
- ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser, actualSubdir string, err error)
+ ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser, err error)
// RecentTag returns the most recent tag on rev or one of its predecessors
// with the given prefix and major version.
diff --git a/libgo/go/cmd/go/internal/modfetch/codehost/git.go b/libgo/go/cmd/go/internal/modfetch/codehost/git.go
index d382e8ac9a9..e329cbc58e7 100644
--- a/libgo/go/cmd/go/internal/modfetch/codehost/git.go
+++ b/libgo/go/cmd/go/internal/modfetch/codehost/git.go
@@ -6,9 +6,11 @@ package codehost
import (
"bytes"
+ "errors"
"fmt"
"io"
"io/ioutil"
+ "net/url"
"os"
"os/exec"
"path/filepath"
@@ -20,7 +22,9 @@ import (
"cmd/go/internal/lockedfile"
"cmd/go/internal/par"
- "cmd/go/internal/semver"
+ "cmd/go/internal/web"
+
+ "golang.org/x/mod/semver"
)
// GitRepo returns the code repository at the given Git remote reference.
@@ -34,6 +38,15 @@ func LocalGitRepo(remote string) (Repo, error) {
return newGitRepoCached(remote, true)
}
+// A notExistError wraps another error to retain its original text
+// but makes it opaquely equivalent to os.ErrNotExist.
+type notExistError struct {
+ err error
+}
+
+func (e notExistError) Error() string { return e.err.Error() }
+func (notExistError) Is(err error) bool { return err == os.ErrNotExist }
+
const gitWorkDirType = "git3"
var gitRepoCache par.Cache
@@ -85,8 +98,9 @@ func newGitRepo(remote string, localOK bool) (Repo, error) {
os.RemoveAll(r.dir)
return nil, err
}
- r.remote = "origin"
}
+ r.remoteURL = r.remote
+ r.remote = "origin"
} else {
// Local path.
// Disallow colon (not in ://) because sometimes
@@ -113,9 +127,9 @@ func newGitRepo(remote string, localOK bool) (Repo, error) {
}
type gitRepo struct {
- remote string
- local bool
- dir string
+ remote, remoteURL string
+ local bool
+ dir string
mu lockedfile.Mutex // protects fetchLevel and git repo state
@@ -166,14 +180,25 @@ func (r *gitRepo) loadRefs() {
// The git protocol sends all known refs and ls-remote filters them on the client side,
// so we might as well record both heads and tags in one shot.
// Most of the time we only care about tags but sometimes we care about heads too.
- out, err := Run(r.dir, "git", "ls-remote", "-q", r.remote)
- if err != nil {
- if rerr, ok := err.(*RunError); ok {
+ out, gitErr := Run(r.dir, "git", "ls-remote", "-q", r.remote)
+ if gitErr != nil {
+ if rerr, ok := gitErr.(*RunError); ok {
if bytes.Contains(rerr.Stderr, []byte("fatal: could not read Username")) {
rerr.HelpText = "Confirm the import path was entered correctly.\nIf this is a private repository, see https://golang.org/doc/faq#git_https for additional information."
}
}
- r.refsErr = err
+
+ // If the remote URL doesn't exist at all, ideally we should treat the whole
+ // repository as nonexistent by wrapping the error in a notExistError.
+ // For HTTP and HTTPS, that's easy to detect: we'll try to fetch the URL
+ // ourselves and see what code it serves.
+ if u, err := url.Parse(r.remoteURL); err == nil && (u.Scheme == "http" || u.Scheme == "https") {
+ if _, err := web.GetBytes(u); errors.Is(err, os.ErrNotExist) {
+ gitErr = notExistError{gitErr}
+ }
+ }
+
+ r.refsErr = gitErr
return
}
@@ -241,13 +266,6 @@ func (r *gitRepo) findRef(hash string) (ref string, ok bool) {
return "", false
}
-func unshallow(gitDir string) []string {
- if _, err := os.Stat(filepath.Join(gitDir, "shallow")); err == nil {
- return []string{"--unshallow"}
- }
- return []string{}
-}
-
// minHashDigits is the minimum number of digits to require
// before accepting a hex digit sequence as potentially identifying
// a specific commit in a git repo. (Of course, users can always
@@ -397,29 +415,27 @@ func (r *gitRepo) stat(rev string) (*RevInfo, error) {
// fetchRefsLocked requires that r.mu remain locked for the duration of the call.
func (r *gitRepo) fetchRefsLocked() error {
if r.fetchLevel < fetchAll {
- if err := r.fetchUnshallow("refs/heads/*:refs/heads/*", "refs/tags/*:refs/tags/*"); err != nil {
+ // NOTE: To work around a bug affecting Git clients up to at least 2.23.0
+ // (2019-08-16), we must first expand the set of local refs, and only then
+ // unshallow the repository as a separate fetch operation. (See
+ // golang.org/issue/34266 and
+ // https://github.com/git/git/blob/4c86140027f4a0d2caaa3ab4bd8bfc5ce3c11c8a/transport.c#L1303-L1309.)
+
+ if _, err := Run(r.dir, "git", "fetch", "-f", r.remote, "refs/heads/*:refs/heads/*", "refs/tags/*:refs/tags/*"); err != nil {
return err
}
+
+ if _, err := os.Stat(filepath.Join(r.dir, "shallow")); err == nil {
+ if _, err := Run(r.dir, "git", "fetch", "--unshallow", "-f", r.remote); err != nil {
+ return err
+ }
+ }
+
r.fetchLevel = fetchAll
}
return nil
}
-func (r *gitRepo) fetchUnshallow(refSpecs ...string) error {
- // To work around a protocol version 2 bug that breaks --unshallow,
- // add -c protocol.version=0.
- // TODO(rsc): The bug is believed to be server-side, meaning only
- // on Google's Git servers. Once the servers are fixed, drop the
- // protocol.version=0. See Google-internal bug b/110495752.
- var protoFlag []string
- unshallowFlag := unshallow(r.dir)
- if len(unshallowFlag) > 0 {
- protoFlag = []string{"-c", "protocol.version=0"}
- }
- _, err := Run(r.dir, "git", protoFlag, "fetch", unshallowFlag, "-f", r.remote, refSpecs)
- return err
-}
-
// statLocal returns a RevInfo describing rev in the local git repository.
// It uses version as info.Version.
func (r *gitRepo) statLocal(version, rev string) (*RevInfo, error) {
@@ -539,39 +555,10 @@ func (r *gitRepo) ReadFileRevs(revs []string, file string, maxSize int64) (map[s
}
defer unlock()
- var refs []string
- var protoFlag []string
- var unshallowFlag []string
- for _, tag := range redo {
- refs = append(refs, "refs/tags/"+tag+":refs/tags/"+tag)
- }
- if len(refs) > 1 {
- unshallowFlag = unshallow(r.dir)
- if len(unshallowFlag) > 0 {
- // To work around a protocol version 2 bug that breaks --unshallow,
- // add -c protocol.version=0.
- // TODO(rsc): The bug is believed to be server-side, meaning only
- // on Google's Git servers. Once the servers are fixed, drop the
- // protocol.version=0. See Google-internal bug b/110495752.
- protoFlag = []string{"-c", "protocol.version=0"}
- }
- }
- if _, err := Run(r.dir, "git", protoFlag, "fetch", unshallowFlag, "-f", r.remote, refs); err != nil {
+ if err := r.fetchRefsLocked(); err != nil {
return nil, err
}
- // TODO(bcmills): after the 1.11 freeze, replace the block above with:
- // if r.fetchLevel <= fetchSome {
- // r.fetchLevel = fetchSome
- // var refs []string
- // for _, tag := range redo {
- // refs = append(refs, "refs/tags/"+tag+":refs/tags/"+tag)
- // }
- // if _, err := Run(r.dir, "git", "fetch", "--update-shallow", "-f", r.remote, refs); err != nil {
- // return nil, err
- // }
- // }
-
if _, err := r.readFileRevs(redo, file, files); err != nil {
return nil, err
}
@@ -809,7 +796,7 @@ func (r *gitRepo) DescendsFrom(rev, tag string) (bool, error) {
return false, err
}
-func (r *gitRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser, actualSubdir string, err error) {
+func (r *gitRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser, err error) {
// TODO: Use maxSize or drop it.
args := []string{}
if subdir != "" {
@@ -817,17 +804,17 @@ func (r *gitRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser,
}
info, err := r.Stat(rev) // download rev into local git repo
if err != nil {
- return nil, "", err
+ return nil, err
}
unlock, err := r.mu.Lock()
if err != nil {
- return nil, "", err
+ return nil, err
}
defer unlock()
if err := ensureGitAttributes(r.dir); err != nil {
- return nil, "", err
+ return nil, err
}
// Incredibly, git produces different archives depending on whether
@@ -838,12 +825,12 @@ func (r *gitRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser,
archive, err := Run(r.dir, "git", "-c", "core.autocrlf=input", "-c", "core.eol=lf", "archive", "--format=zip", "--prefix=prefix/", info.Name, args)
if err != nil {
if bytes.Contains(err.(*RunError).Stderr, []byte("did not match any files")) {
- return nil, "", os.ErrNotExist
+ return nil, os.ErrNotExist
}
- return nil, "", err
+ return nil, err
}
- return ioutil.NopCloser(bytes.NewReader(archive)), "", nil
+ return ioutil.NopCloser(bytes.NewReader(archive)), nil
}
// ensureGitAttributes makes sure export-subst and export-ignore features are
diff --git a/libgo/go/cmd/go/internal/modfetch/codehost/git_test.go b/libgo/go/cmd/go/internal/modfetch/codehost/git_test.go
index da9e7050407..cc32a1eb51c 100644
--- a/libgo/go/cmd/go/internal/modfetch/codehost/git_test.go
+++ b/libgo/go/cmd/go/internal/modfetch/codehost/git_test.go
@@ -78,7 +78,16 @@ func testMain(m *testing.M) int {
func testRepo(remote string) (Repo, error) {
if remote == "localGitRepo" {
- return LocalGitRepo(filepath.ToSlash(localGitRepo))
+ // Convert absolute path to file URL. LocalGitRepo will not accept
+ // Windows absolute paths because they look like a host:path remote.
+ // TODO(golang.org/issue/32456): use url.FromFilePath when implemented.
+ var url string
+ if strings.HasPrefix(localGitRepo, "/") {
+ url = "file://" + localGitRepo
+ } else {
+ url = "file:///" + filepath.ToSlash(localGitRepo)
+ }
+ return LocalGitRepo(url)
}
kind := "git"
for _, k := range []string{"hg"} {
@@ -246,12 +255,11 @@ func TestReadFile(t *testing.T) {
}
var readZipTests = []struct {
- repo string
- rev string
- subdir string
- actualSubdir string
- err string
- files map[string]uint64
+ repo string
+ rev string
+ subdir string
+ err string
+ files map[string]uint64
}{
{
repo: gitrepo1,
@@ -408,7 +416,7 @@ func TestReadZip(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- rc, actualSubdir, err := r.ReadZip(tt.rev, tt.subdir, 100000)
+ rc, err := r.ReadZip(tt.rev, tt.subdir, 100000)
if err != nil {
if tt.err == "" {
t.Fatalf("ReadZip: unexpected error %v", err)
@@ -425,9 +433,6 @@ func TestReadZip(t *testing.T) {
if tt.err != "" {
t.Fatalf("ReadZip: no error, wanted %v", tt.err)
}
- if actualSubdir != tt.actualSubdir {
- t.Fatalf("ReadZip: actualSubdir = %q, want %q", actualSubdir, tt.actualSubdir)
- }
zipdata, err := ioutil.ReadAll(rc)
if err != nil {
t.Fatal(err)
diff --git a/libgo/go/cmd/go/internal/modfetch/codehost/shell.go b/libgo/go/cmd/go/internal/modfetch/codehost/shell.go
index 7b813c37401..835bc53c0dd 100644
--- a/libgo/go/cmd/go/internal/modfetch/codehost/shell.go
+++ b/libgo/go/cmd/go/internal/modfetch/codehost/shell.go
@@ -109,7 +109,7 @@ func main() {
if subdir == "-" {
subdir = ""
}
- rc, _, err := repo.ReadZip(f[1], subdir, 10<<20)
+ rc, err := repo.ReadZip(f[1], subdir, 10<<20)
if err != nil {
fmt.Fprintf(os.Stderr, "?%s\n", err)
continue
diff --git a/libgo/go/cmd/go/internal/modfetch/codehost/svn.go b/libgo/go/cmd/go/internal/modfetch/codehost/svn.go
new file mode 100644
index 00000000000..6ec9e59c9c6
--- /dev/null
+++ b/libgo/go/cmd/go/internal/modfetch/codehost/svn.go
@@ -0,0 +1,154 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package codehost
+
+import (
+ "archive/zip"
+ "encoding/xml"
+ "fmt"
+ "io"
+ "os"
+ "path"
+ "path/filepath"
+ "time"
+)
+
+func svnParseStat(rev, out string) (*RevInfo, error) {
+ var log struct {
+ Logentry struct {
+ Revision int64 `xml:"revision,attr"`
+ Date string `xml:"date"`
+ } `xml:"logentry"`
+ }
+ if err := xml.Unmarshal([]byte(out), &log); err != nil {
+ return nil, vcsErrorf("unexpected response from svn log --xml: %v\n%s", err, out)
+ }
+
+ t, err := time.Parse(time.RFC3339, log.Logentry.Date)
+ if err != nil {
+ return nil, vcsErrorf("unexpected response from svn log --xml: %v\n%s", err, out)
+ }
+
+ info := &RevInfo{
+ Name: fmt.Sprintf("%d", log.Logentry.Revision),
+ Short: fmt.Sprintf("%012d", log.Logentry.Revision),
+ Time: t.UTC(),
+ Version: rev,
+ }
+ return info, nil
+}
+
+func svnReadZip(dst io.Writer, workDir, rev, subdir, remote string) (err error) {
+ // The subversion CLI doesn't provide a command to write the repository
+ // directly to an archive, so we need to export it to the local filesystem
+ // instead. Unfortunately, the local filesystem might apply arbitrary
+ // normalization to the filenames, so we need to obtain those directly.
+ //
+ // 'svn export' prints the filenames as they are written, but from reading the
+ // svn source code (as of revision 1868933), those filenames are encoded using
+ // the system locale rather than preserved byte-for-byte from the origin. For
+ // our purposes, that won't do, but we don't want to go mucking around with
+ // the user's locale settings either — that could impact error messages, and
+ // we don't know what locales the user has available or what LC_* variables
+ // their platform supports.
+ //
+ // Instead, we'll do a two-pass export: first we'll run 'svn list' to get the
+ // canonical filenames, then we'll 'svn export' and look for those filenames
+ // in the local filesystem. (If there is an encoding problem at that point, we
+ // would probably reject the resulting module anyway.)
+
+ remotePath := remote
+ if subdir != "" {
+ remotePath += "/" + subdir
+ }
+
+ out, err := Run(workDir, []string{
+ "svn", "list",
+ "--non-interactive",
+ "--xml",
+ "--incremental",
+ "--recursive",
+ "--revision", rev,
+ "--", remotePath,
+ })
+ if err != nil {
+ return err
+ }
+
+ type listEntry struct {
+ Kind string `xml:"kind,attr"`
+ Name string `xml:"name"`
+ Size int64 `xml:"size"`
+ }
+ var list struct {
+ Entries []listEntry `xml:"entry"`
+ }
+ if err := xml.Unmarshal(out, &list); err != nil {
+ return vcsErrorf("unexpected response from svn list --xml: %v\n%s", err, out)
+ }
+
+ exportDir := filepath.Join(workDir, "export")
+ // Remove any existing contents from a previous (failed) run.
+ if err := os.RemoveAll(exportDir); err != nil {
+ return err
+ }
+ defer os.RemoveAll(exportDir) // best-effort
+
+ _, err = Run(workDir, []string{
+ "svn", "export",
+ "--non-interactive",
+ "--quiet",
+
+ // Suppress any platform- or host-dependent transformations.
+ "--native-eol", "LF",
+ "--ignore-externals",
+ "--ignore-keywords",
+
+ "--revision", rev,
+ "--", remotePath,
+ exportDir,
+ })
+ if err != nil {
+ return err
+ }
+
+ // Scrape the exported files out of the filesystem and encode them in the zipfile.
+
+ // “All files in the zip file are expected to be
+ // nested in a single top-level directory, whose name is not specified.”
+ // We'll (arbitrarily) choose the base of the remote path.
+ basePath := path.Join(path.Base(remote), subdir)
+
+ zw := zip.NewWriter(dst)
+ for _, e := range list.Entries {
+ if e.Kind != "file" {
+ continue
+ }
+
+ zf, err := zw.Create(path.Join(basePath, e.Name))
+ if err != nil {
+ return err
+ }
+
+ f, err := os.Open(filepath.Join(exportDir, e.Name))
+ if err != nil {
+ if os.IsNotExist(err) {
+ return vcsErrorf("file reported by 'svn list', but not written by 'svn export': %s", e.Name)
+ }
+ return fmt.Errorf("error opening file created by 'svn export': %v", err)
+ }
+
+ n, err := io.Copy(zf, f)
+ f.Close()
+ if err != nil {
+ return err
+ }
+ if n != e.Size {
+ return vcsErrorf("file size differs between 'svn list' and 'svn export': file %s listed as %v bytes, but exported as %v bytes", e.Name, e.Size, n)
+ }
+ }
+
+ return zw.Close()
+}
diff --git a/libgo/go/cmd/go/internal/modfetch/codehost/vcs.go b/libgo/go/cmd/go/internal/modfetch/codehost/vcs.go
index 48238f176c6..7284557f4ba 100644
--- a/libgo/go/cmd/go/internal/modfetch/codehost/vcs.go
+++ b/libgo/go/cmd/go/internal/modfetch/codehost/vcs.go
@@ -5,7 +5,7 @@
package codehost
import (
- "encoding/xml"
+ "errors"
"fmt"
"internal/lazyregexp"
"io"
@@ -122,19 +122,20 @@ func newVCSRepo(vcs, remote string) (Repo, error) {
const vcsWorkDirType = "vcs1."
type vcsCmd struct {
- vcs string // vcs name "hg"
- init func(remote string) []string // cmd to init repo to track remote
- tags func(remote string) []string // cmd to list local tags
- tagRE *lazyregexp.Regexp // regexp to extract tag names from output of tags cmd
- branches func(remote string) []string // cmd to list local branches
- branchRE *lazyregexp.Regexp // regexp to extract branch names from output of tags cmd
- badLocalRevRE *lazyregexp.Regexp // regexp of names that must not be served out of local cache without doing fetch first
- statLocal func(rev, remote string) []string // cmd to stat local rev
- parseStat func(rev, out string) (*RevInfo, error) // cmd to parse output of statLocal
- fetch []string // cmd to fetch everything from remote
- latest string // name of latest commit on remote (tip, HEAD, etc)
- readFile func(rev, file, remote string) []string // cmd to read rev's file
- readZip func(rev, subdir, remote, target string) []string // cmd to read rev's subdir as zip file
+ vcs string // vcs name "hg"
+ init func(remote string) []string // cmd to init repo to track remote
+ tags func(remote string) []string // cmd to list local tags
+ tagRE *lazyregexp.Regexp // regexp to extract tag names from output of tags cmd
+ branches func(remote string) []string // cmd to list local branches
+ branchRE *lazyregexp.Regexp // regexp to extract branch names from output of tags cmd
+ badLocalRevRE *lazyregexp.Regexp // regexp of names that must not be served out of local cache without doing fetch first
+ statLocal func(rev, remote string) []string // cmd to stat local rev
+ parseStat func(rev, out string) (*RevInfo, error) // cmd to parse output of statLocal
+ fetch []string // cmd to fetch everything from remote
+ latest string // name of latest commit on remote (tip, HEAD, etc)
+ readFile func(rev, file, remote string) []string // cmd to read rev's file
+ readZip func(rev, subdir, remote, target string) []string // cmd to read rev's subdir as zip file
+ doReadZip func(dst io.Writer, workDir, rev, subdir, remote string) error // arbitrary function to read rev's subdir as zip file
}
var re = lazyregexp.New
@@ -191,7 +192,7 @@ var vcsCmds = map[string]*vcsCmd{
readFile: func(rev, file, remote string) []string {
return []string{"svn", "cat", "--", remote + "/" + file + "@" + rev}
},
- // TODO: zip
+ doReadZip: svnReadZip,
},
"bzr": {
@@ -417,14 +418,14 @@ func (r *vcsRepo) DescendsFrom(rev, tag string) (bool, error) {
return false, vcsErrorf("DescendsFrom not implemented")
}
-func (r *vcsRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser, actualSubdir string, err error) {
- if r.cmd.readZip == nil {
- return nil, "", vcsErrorf("ReadZip not implemented for %s", r.cmd.vcs)
+func (r *vcsRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser, err error) {
+ if r.cmd.readZip == nil && r.cmd.doReadZip == nil {
+ return nil, vcsErrorf("ReadZip not implemented for %s", r.cmd.vcs)
}
unlock, err := r.mu.Lock()
if err != nil {
- return nil, "", err
+ return nil, err
}
defer unlock()
@@ -433,9 +434,19 @@ func (r *vcsRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser,
}
f, err := ioutil.TempFile("", "go-readzip-*.zip")
if err != nil {
- return nil, "", err
+ return nil, err
}
- if r.cmd.vcs == "fossil" {
+ if r.cmd.doReadZip != nil {
+ lw := &limitedWriter{
+ W: f,
+ N: maxSize,
+ ErrLimitReached: errors.New("ReadZip: encoded file exceeds allowed size"),
+ }
+ err = r.cmd.doReadZip(lw, r.dir, rev, subdir, r.remote)
+ if err == nil {
+ _, err = f.Seek(0, io.SeekStart)
+ }
+ } else if r.cmd.vcs == "fossil" {
// If you run
// fossil zip -R .fossil --name prefix trunk /tmp/x.zip
// fossil fails with "unable to create directory /tmp" [sic].
@@ -454,9 +465,9 @@ func (r *vcsRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser,
if err != nil {
f.Close()
os.Remove(f.Name())
- return nil, "", err
+ return nil, err
}
- return &deleteCloser{f}, "", nil
+ return &deleteCloser{f}, nil
}
// deleteCloser is a file that gets deleted on Close.
@@ -502,31 +513,6 @@ func hgParseStat(rev, out string) (*RevInfo, error) {
return info, nil
}
-func svnParseStat(rev, out string) (*RevInfo, error) {
- var log struct {
- Logentry struct {
- Revision int64 `xml:"revision,attr"`
- Date string `xml:"date"`
- } `xml:"logentry"`
- }
- if err := xml.Unmarshal([]byte(out), &log); err != nil {
- return nil, vcsErrorf("unexpected response from svn log --xml: %v\n%s", err, out)
- }
-
- t, err := time.Parse(time.RFC3339, log.Logentry.Date)
- if err != nil {
- return nil, vcsErrorf("unexpected response from svn log --xml: %v\n%s", err, out)
- }
-
- info := &RevInfo{
- Name: fmt.Sprintf("%d", log.Logentry.Revision),
- Short: fmt.Sprintf("%012d", log.Logentry.Revision),
- Time: t.UTC(),
- Version: rev,
- }
- return info, nil
-}
-
func bzrParseStat(rev, out string) (*RevInfo, error) {
var revno int64
var tm time.Time
@@ -606,3 +592,25 @@ func fossilParseStat(rev, out string) (*RevInfo, error) {
}
return nil, vcsErrorf("unexpected response from fossil info: %q", out)
}
+
+type limitedWriter struct {
+ W io.Writer
+ N int64
+ ErrLimitReached error
+}
+
+func (l *limitedWriter) Write(p []byte) (n int, err error) {
+ if l.N > 0 {
+ max := len(p)
+ if l.N < int64(max) {
+ max = int(l.N)
+ }
+ n, err = l.W.Write(p[:max])
+ l.N -= int64(n)
+ if err != nil || n >= len(p) {
+ return n, err
+ }
+ }
+
+ return n, l.ErrLimitReached
+}
diff --git a/libgo/go/cmd/go/internal/modfetch/coderepo.go b/libgo/go/cmd/go/internal/modfetch/coderepo.go
index f15ce67d460..de757ecd27b 100644
--- a/libgo/go/cmd/go/internal/modfetch/coderepo.go
+++ b/libgo/go/cmd/go/internal/modfetch/coderepo.go
@@ -6,19 +6,23 @@ package modfetch
import (
"archive/zip"
+ "bytes"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"path"
+ "sort"
"strings"
"time"
"cmd/go/internal/modfetch/codehost"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
- "cmd/go/internal/semver"
+
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
+ modzip "golang.org/x/mod/zip"
)
// A codeRepo implements modfetch.Repo using an underlying codehost.Repo.
@@ -140,11 +144,13 @@ func (r *codeRepo) Versions(prefix string) ([]string, error) {
}
tags, err := r.code.Tags(p)
if err != nil {
- return nil, err
+ return nil, &module.ModuleError{
+ Path: r.modPath,
+ Err: err,
+ }
}
- list := []string{}
- var incompatible []string
+ var list, incompatible []string
for _, tag := range tags {
if !strings.HasPrefix(tag, p) {
continue
@@ -156,32 +162,114 @@ func (r *codeRepo) Versions(prefix string) ([]string, error) {
if v == "" || v != module.CanonicalVersion(v) || IsPseudoVersion(v) {
continue
}
- if err := module.MatchPathMajor(v, r.pathMajor); err != nil {
+
+ if err := module.CheckPathMajor(v, r.pathMajor); err != nil {
if r.codeDir == "" && r.pathMajor == "" && semver.Major(v) > "v1" {
incompatible = append(incompatible, v)
}
continue
}
+
list = append(list, v)
}
+ SortVersions(list)
+ SortVersions(incompatible)
+
+ return r.appendIncompatibleVersions(list, incompatible)
+}
- if len(incompatible) > 0 {
- // Check for later versions that were created not following semantic import versioning,
- // as indicated by the absence of a go.mod file. Those versions can be addressed
- // by referring to them with a +incompatible suffix, as in v17.0.0+incompatible.
- files, err := r.code.ReadFileRevs(incompatible, "go.mod", codehost.MaxGoMod)
+// appendIncompatibleVersions appends "+incompatible" versions to list if
+// appropriate, returning the final list.
+//
+// The incompatible list contains candidate versions without the '+incompatible'
+// prefix.
+//
+// Both list and incompatible must be sorted in semantic order.
+func (r *codeRepo) appendIncompatibleVersions(list, incompatible []string) ([]string, error) {
+ if len(incompatible) == 0 || r.pathMajor != "" {
+ // No +incompatible versions are possible, so no need to check them.
+ return list, nil
+ }
+
+ // We assume that if the latest release of any major version has a go.mod
+ // file, all subsequent major versions will also have go.mod files (and thus
+ // be ineligible for use as +incompatible versions).
+ // If we're wrong about a major version, users will still be able to 'go get'
+ // specific higher versions explicitly — they just won't affect 'latest' or
+ // appear in 'go list'.
+ //
+ // Conversely, we assume that if the latest release of any major version lacks
+ // a go.mod file, all versions also lack go.mod files. If we're wrong, we may
+ // include a +incompatible version that isn't really valid, but most
+ // operations won't try to use that version anyway.
+ //
+ // These optimizations bring
+ // 'go list -versions -m github.com/openshift/origin' down from 1m58s to 0m37s.
+ // That's still not great, but a substantial improvement.
+
+ versionHasGoMod := func(v string) (bool, error) {
+ _, err := r.code.ReadFile(v, "go.mod", codehost.MaxGoMod)
+ if err == nil {
+ return true, nil
+ }
+ if !os.IsNotExist(err) {
+ return false, &module.ModuleError{
+ Path: r.modPath,
+ Err: err,
+ }
+ }
+ return false, nil
+ }
+
+ if len(list) > 0 {
+ ok, err := versionHasGoMod(list[len(list)-1])
if err != nil {
return nil, err
}
- for _, rev := range incompatible {
- f := files[rev]
- if os.IsNotExist(f.Err) {
- list = append(list, rev+"+incompatible")
- }
+ if ok {
+ // The latest compatible version has a go.mod file, so assume that all
+ // subsequent versions do as well, and do not include any +incompatible
+ // versions. Even if we are wrong, the author clearly intends module
+ // consumers to be on the v0/v1 line instead of a higher +incompatible
+ // version. (See https://golang.org/issue/34189.)
+ //
+ // We know of at least two examples where this behavior is desired
+ // (github.com/russross/blackfriday@v2.0.0 and
+ // github.com/libp2p/go-libp2p@v6.0.23), and (as of 2019-10-29) have no
+ // concrete examples for which it is undesired.
+ return list, nil
}
}
- SortVersions(list)
+ var lastMajor string
+ for i, v := range incompatible {
+ major := semver.Major(v)
+ if major == lastMajor {
+ list = append(list, v+"+incompatible")
+ continue
+ }
+
+ rem := incompatible[i:]
+ j := sort.Search(len(rem), func(j int) bool {
+ return semver.Major(rem[j]) != major
+ })
+ latestAtMajor := rem[j-1]
+
+ ok, err := versionHasGoMod(latestAtMajor)
+ if err != nil {
+ return nil, err
+ }
+ if ok {
+ // This major version has a go.mod file, so it is not allowed as
+ // +incompatible. Subsequent major versions are likely to also have
+ // go.mod files, so stop here.
+ break
+ }
+
+ lastMajor = major
+ list = append(list, v+"+incompatible")
+ }
+
return list, nil
}
@@ -271,7 +359,7 @@ func (r *codeRepo) convert(info *codehost.RevInfo, statVers string) (*RevInfo, e
Path: r.modPath,
Err: &module.InvalidVersionError{
Version: info2.Version,
- Err: notExistError(err.Error()),
+ Err: notExistError{err: err},
},
}
}
@@ -287,7 +375,7 @@ func (r *codeRepo) convert(info *codehost.RevInfo, statVers string) (*RevInfo, e
}
}
- if err := module.MatchPathMajor(strings.TrimSuffix(info2.Version, "+incompatible"), r.pathMajor); err == nil {
+ if err := module.CheckPathMajor(strings.TrimSuffix(info2.Version, "+incompatible"), r.pathMajor); err == nil {
return nil, invalidf("+incompatible suffix not allowed: major version %s is compatible", semver.Major(info2.Version))
}
}
@@ -311,7 +399,7 @@ func (r *codeRepo) convert(info *codehost.RevInfo, statVers string) (*RevInfo, e
return checkGoMod()
}
- if err := module.MatchPathMajor(info2.Version, r.pathMajor); err != nil {
+ if err := module.CheckPathMajor(info2.Version, r.pathMajor); err != nil {
if canUseIncompatible() {
info2.Version += "+incompatible"
return checkGoMod()
@@ -359,7 +447,7 @@ func (r *codeRepo) convert(info *codehost.RevInfo, statVers string) (*RevInfo, e
tagIsCanonical = true
}
- if err := module.MatchPathMajor(v, r.pathMajor); err != nil {
+ if err := module.CheckPathMajor(v, r.pathMajor); err != nil {
if canUseIncompatible() {
return v + "+incompatible", tagIsCanonical
}
@@ -458,7 +546,7 @@ func (r *codeRepo) validatePseudoVersion(info *codehost.RevInfo, version string)
}
}()
- if err := module.MatchPathMajor(version, r.pathMajor); err != nil {
+ if err := module.CheckPathMajor(version, r.pathMajor); err != nil {
return err
}
@@ -631,9 +719,6 @@ func (r *codeRepo) findDir(version string) (rev, dir string, gomod []byte, err e
// because of replacement modules. This might be a fork of
// the real module, found at a different path, usable only in
// a replace directive.
- //
- // TODO(bcmills): This doesn't seem right. Investigate futher.
- // (Notably: why can't we replace foo/v2 with fork-of-foo/v3?)
dir2 := path.Join(r.codeDir, r.pathMajor[1:])
file2 = path.Join(dir2, "go.mod")
gomod2, err2 := r.code.ReadFile(rev, file2, codehost.MaxGoMod)
@@ -659,11 +744,11 @@ func (r *codeRepo) findDir(version string) (rev, dir string, gomod []byte, err e
// Not v2/go.mod, so it's either go.mod or nothing. Which is it?
if found1 {
- // Explicit go.mod with matching module path OK.
+ // Explicit go.mod with matching major version ok.
return rev, r.codeDir, gomod1, nil
}
if err1 == nil {
- // Explicit go.mod with non-matching module path disallowed.
+ // Explicit go.mod with non-matching major version disallowed.
suffix := ""
if file2 != "" {
suffix = fmt.Sprintf(" (and ...%s/go.mod does not exist)", r.pathMajor)
@@ -674,6 +759,9 @@ func (r *codeRepo) findDir(version string) (rev, dir string, gomod []byte, err e
if r.pathMajor != "" { // ".v1", ".v2" for gopkg.in
return "", "", nil, fmt.Errorf("%s has non-...%s module path %q%s at revision %s", file1, r.pathMajor, mpath1, suffix, rev)
}
+ if _, _, ok := module.SplitPathVersion(mpath1); !ok {
+ return "", "", nil, fmt.Errorf("%s has malformed module path %q%s at revision %s", file1, mpath1, suffix, rev)
+ }
return "", "", nil, fmt.Errorf("%s has post-%s module path %q%s at revision %s", file1, semver.Major(version), mpath1, suffix, rev)
}
@@ -690,24 +778,43 @@ func (r *codeRepo) findDir(version string) (rev, dir string, gomod []byte, err e
return "", "", nil, fmt.Errorf("missing %s/go.mod at revision %s", r.pathPrefix, rev)
}
+// isMajor reports whether the versions allowed for mpath are compatible with
+// the major version(s) implied by pathMajor, or false if mpath has an invalid
+// version suffix.
func isMajor(mpath, pathMajor string) bool {
if mpath == "" {
+ // If we don't have a path, we don't know what version(s) it is compatible with.
+ return false
+ }
+ _, mpathMajor, ok := module.SplitPathVersion(mpath)
+ if !ok {
+ // An invalid module path is not compatible with any version.
return false
}
if pathMajor == "" {
- // mpath must NOT have version suffix.
- i := len(mpath)
- for i > 0 && '0' <= mpath[i-1] && mpath[i-1] <= '9' {
- i--
- }
- if i < len(mpath) && i >= 2 && mpath[i-1] == 'v' && mpath[i-2] == '/' {
- // Found valid suffix.
+ // All of the valid versions for a gopkg.in module that requires major
+ // version v0 or v1 are compatible with the "v0 or v1" implied by an empty
+ // pathMajor.
+ switch module.PathMajorPrefix(mpathMajor) {
+ case "", "v0", "v1":
+ return true
+ default:
return false
}
- return true
}
- // Otherwise pathMajor is ".v1", ".v2" (gopkg.in), or "/v2", "/v3" etc.
- return strings.HasSuffix(mpath, pathMajor)
+ if mpathMajor == "" {
+ // Even if pathMajor is ".v0" or ".v1", we can't be sure that a module
+ // without a suffix is tagged appropriately. Besides, we don't expect clones
+ // of non-gopkg.in modules to have gopkg.in paths, so a non-empty,
+ // non-gopkg.in mpath is probably the wrong module for any such pathMajor
+ // anyway.
+ return false
+ }
+ // If both pathMajor and mpathMajor are non-empty, then we only care that they
+ // have the same major-version validation rules. A clone fetched via a /v2
+ // path might replace a module with path gopkg.in/foo.v2-unstable, and that's
+ // ok.
+ return pathMajor[1:] == mpathMajor[1:]
}
func (r *codeRepo) GoMod(version string) (data []byte, err error) {
@@ -774,19 +881,16 @@ func (r *codeRepo) Zip(dst io.Writer, version string) error {
}
}
- rev, dir, _, err := r.findDir(version)
+ rev, subdir, _, err := r.findDir(version)
if err != nil {
return err
}
- dl, actualDir, err := r.code.ReadZip(rev, dir, codehost.MaxZipFile)
+ dl, err := r.code.ReadZip(rev, subdir, codehost.MaxZipFile)
if err != nil {
return err
}
defer dl.Close()
- if actualDir != "" && !hasPathPrefix(dir, actualDir) {
- return fmt.Errorf("internal error: downloading %v %v: dir=%q but actualDir=%q", r.modPath, rev, dir, actualDir)
- }
- subdir := strings.Trim(strings.TrimPrefix(dir, actualDir), "/")
+ subdir = strings.Trim(subdir, "/")
// Spool to local file.
f, err := ioutil.TempFile("", "go-codehost-")
@@ -817,13 +921,12 @@ func (r *codeRepo) Zip(dst io.Writer, version string) error {
return err
}
- zw := zip.NewWriter(dst)
+ var files []modzip.File
if subdir != "" {
subdir += "/"
}
haveLICENSE := false
topPrefix := ""
- haveGoMod := make(map[string]bool)
for _, zf := range zr.File {
if topPrefix == "" {
i := strings.Index(zf.Name, "/")
@@ -835,106 +938,61 @@ func (r *codeRepo) Zip(dst io.Writer, version string) error {
if !strings.HasPrefix(zf.Name, topPrefix) {
return fmt.Errorf("zip file contains more than one top-level directory")
}
- dir, file := path.Split(zf.Name)
- if file == "go.mod" {
- haveGoMod[dir] = true
- }
- }
- root := topPrefix + subdir
- inSubmodule := func(name string) bool {
- for {
- dir, _ := path.Split(name)
- if len(dir) <= len(root) {
- return false
- }
- if haveGoMod[dir] {
- return true
- }
- name = dir[:len(dir)-1]
- }
- }
-
- for _, zf := range zr.File {
- if !zf.FileInfo().Mode().IsRegular() {
- // Skip symlinks (golang.org/issue/27093).
- continue
- }
-
- if topPrefix == "" {
- i := strings.Index(zf.Name, "/")
- if i < 0 {
- return fmt.Errorf("missing top-level directory prefix")
- }
- topPrefix = zf.Name[:i+1]
- }
- if strings.HasSuffix(zf.Name, "/") { // drop directory dummy entries
- continue
- }
- if !strings.HasPrefix(zf.Name, topPrefix) {
- return fmt.Errorf("zip file contains more than one top-level directory")
- }
name := strings.TrimPrefix(zf.Name, topPrefix)
if !strings.HasPrefix(name, subdir) {
continue
}
- if name == ".hg_archival.txt" {
- // Inserted by hg archive.
- // Not correct to drop from other version control systems, but too bad.
- continue
- }
name = strings.TrimPrefix(name, subdir)
- if isVendoredPackage(name) {
- continue
- }
- if inSubmodule(zf.Name) {
+ if name == "" || strings.HasSuffix(name, "/") {
continue
}
- base := path.Base(name)
- if strings.ToLower(base) == "go.mod" && base != "go.mod" {
- return fmt.Errorf("zip file contains %s, want all lower-case go.mod", zf.Name)
- }
+ files = append(files, zipFile{name: name, f: zf})
if name == "LICENSE" {
haveLICENSE = true
}
- size := int64(zf.UncompressedSize64)
- if size < 0 || maxSize < size {
- return fmt.Errorf("module source tree too big")
- }
- maxSize -= size
-
- rc, err := zf.Open()
- if err != nil {
- return err
- }
- w, err := zw.Create(r.modPrefix(version) + "/" + name)
- if err != nil {
- return err
- }
- lr := &io.LimitedReader{R: rc, N: size + 1}
- if _, err := io.Copy(w, lr); err != nil {
- return err
- }
- if lr.N <= 0 {
- return fmt.Errorf("individual file too large")
- }
}
if !haveLICENSE && subdir != "" {
data, err := r.code.ReadFile(rev, "LICENSE", codehost.MaxLICENSE)
if err == nil {
- w, err := zw.Create(r.modPrefix(version) + "/LICENSE")
- if err != nil {
- return err
- }
- if _, err := w.Write(data); err != nil {
- return err
- }
+ files = append(files, dataFile{name: "LICENSE", data: data})
}
}
- return zw.Close()
+ return modzip.Create(dst, module.Version{Path: r.modPath, Version: version}, files)
+}
+
+type zipFile struct {
+ name string
+ f *zip.File
+}
+
+func (f zipFile) Path() string { return f.name }
+func (f zipFile) Lstat() (os.FileInfo, error) { return f.f.FileInfo(), nil }
+func (f zipFile) Open() (io.ReadCloser, error) { return f.f.Open() }
+
+type dataFile struct {
+ name string
+ data []byte
+}
+
+func (f dataFile) Path() string { return f.name }
+func (f dataFile) Lstat() (os.FileInfo, error) { return dataFileInfo{f}, nil }
+func (f dataFile) Open() (io.ReadCloser, error) {
+ return ioutil.NopCloser(bytes.NewReader(f.data)), nil
}
+type dataFileInfo struct {
+ f dataFile
+}
+
+func (fi dataFileInfo) Name() string { return path.Base(fi.f.name) }
+func (fi dataFileInfo) Size() int64 { return int64(len(fi.f.data)) }
+func (fi dataFileInfo) Mode() os.FileMode { return 0644 }
+func (fi dataFileInfo) ModTime() time.Time { return time.Time{} }
+func (fi dataFileInfo) IsDir() bool { return false }
+func (fi dataFileInfo) Sys() interface{} { return nil }
+
// hasPathPrefix reports whether the path s begins with the
// elements in prefix.
func hasPathPrefix(s, prefix string) bool {
diff --git a/libgo/go/cmd/go/internal/modfetch/coderepo_test.go b/libgo/go/cmd/go/internal/modfetch/coderepo_test.go
index 1f2b95bd238..39830948fb0 100644
--- a/libgo/go/cmd/go/internal/modfetch/coderepo_test.go
+++ b/libgo/go/cmd/go/internal/modfetch/coderepo_test.go
@@ -6,7 +6,11 @@ package modfetch
import (
"archive/zip"
+ "crypto/sha256"
+ "encoding/hex"
+ "hash"
"internal/testenv"
+ "io"
"io/ioutil"
"log"
"os"
@@ -17,6 +21,8 @@ import (
"cmd/go/internal/cfg"
"cmd/go/internal/modfetch/codehost"
+
+ "golang.org/x/mod/sumdb/dirhash"
)
func TestMain(m *testing.M) {
@@ -52,20 +58,22 @@ var altVgotests = map[string]string{
}
type codeRepoTest struct {
- vcs string
- path string
- lookerr string
- mpath string
- rev string
- err string
- version string
- name string
- short string
- time time.Time
- gomod string
- gomoderr string
- zip []string
- ziperr string
+ vcs string
+ path string
+ lookErr string
+ mpath string
+ rev string
+ err string
+ version string
+ name string
+ short string
+ time time.Time
+ gomod string
+ gomodErr string
+ zip []string
+ zipErr string
+ zipSum string
+ zipFileHash string
}
var codeRepoTests = []codeRepoTest{
@@ -82,6 +90,8 @@ var codeRepoTests = []codeRepoTest{
"README.md",
"pkg/p.go",
},
+ zipSum: "h1:zVEjciLdlk/TPWCOyZo7k24T+tOKRQC+u8MKq/xS80I=",
+ zipFileHash: "738a00ddbfe8c329dce6b48e1f23c8e22a92db50f3cfb2653caa0d62676bc09c",
},
{
vcs: "git",
@@ -96,6 +106,8 @@ var codeRepoTests = []codeRepoTest{
"README.md",
"pkg/p.go",
},
+ zipSum: "h1:nOznk2xKsLGkTnXe0q9t1Ewt9jxK+oadtafSUqHM3Ec=",
+ zipFileHash: "bacb08f391e29d2eaaef8281b5c129ee6d890e608ee65877e0003c0181a766c8",
},
{
vcs: "git",
@@ -116,6 +128,8 @@ var codeRepoTests = []codeRepoTest{
"README.md",
"pkg/p.go",
},
+ zipSum: "h1:e040hOoWGeuJLawDjK9DW6med+cz9FxMFYDMOVG8ctQ=",
+ zipFileHash: "74caab65cfbea427c341fa815f3bb0378681d8f0e3cf62a7f207014263ec7be3",
},
{
vcs: "git",
@@ -140,6 +154,8 @@ var codeRepoTests = []codeRepoTest{
"README.md",
"pkg/p.go",
},
+ zipSum: "h1:e040hOoWGeuJLawDjK9DW6med+cz9FxMFYDMOVG8ctQ=",
+ zipFileHash: "74caab65cfbea427c341fa815f3bb0378681d8f0e3cf62a7f207014263ec7be3",
},
{
vcs: "git",
@@ -201,6 +217,8 @@ var codeRepoTests = []codeRepoTest{
"pkg/p.go",
"LICENSE",
},
+ zipSum: "h1:iMsJ/9uQsk6MnZNnJK311f11QiSlmN92Q2aSjCywuJY=",
+ zipFileHash: "95801bfa69c5197ae809af512946d22f22850068527cd78100ae3f176bc8043b",
},
{
vcs: "git",
@@ -217,16 +235,20 @@ var codeRepoTests = []codeRepoTest{
"go.mod",
"pkg/p.go",
},
+ zipSum: "h1:M69k7q+8bQ+QUpHov45Z/NoR8rj3DsQJUnXLWvf01+Q=",
+ zipFileHash: "58af45fb248d320ea471f568e006379e2b8d71d6d1663f9b19b2e00fd9ac9265",
},
{
- vcs: "git",
- path: "github.com/rsc/vgotest1/v2",
- rev: "v2.0.1",
- version: "v2.0.1",
- name: "ea65f87c8f52c15ea68f3bdd9925ef17e20d91e9",
- short: "ea65f87c8f52",
- time: time.Date(2018, 2, 19, 23, 14, 23, 0, time.UTC),
- gomod: "module \"github.com/rsc/vgotest1/v2\" // root go.mod\n",
+ vcs: "git",
+ path: "github.com/rsc/vgotest1/v2",
+ rev: "v2.0.1",
+ version: "v2.0.1",
+ name: "ea65f87c8f52c15ea68f3bdd9925ef17e20d91e9",
+ short: "ea65f87c8f52",
+ time: time.Date(2018, 2, 19, 23, 14, 23, 0, time.UTC),
+ gomod: "module \"github.com/rsc/vgotest1/v2\" // root go.mod\n",
+ zipSum: "h1:QmgYy/zt+uoWhDpcsgrSVzYFvKtBEjl5zT/FRz9GTzA=",
+ zipFileHash: "1aedf1546d322a0121879ddfd6d0e8bfbd916d2cafbeb538ddb440e04b04b9ef",
},
{
vcs: "git",
@@ -249,25 +271,29 @@ var codeRepoTests = []codeRepoTest{
err: "github.com/rsc/vgotest1/go.mod and .../v2/go.mod both have .../v2 module paths at revision v2.0.4",
},
{
- vcs: "git",
- path: "github.com/rsc/vgotest1/v2",
- rev: "v2.0.5",
- version: "v2.0.5",
- name: "2f615117ce481c8efef46e0cc0b4b4dccfac8fea",
- short: "2f615117ce48",
- time: time.Date(2018, 2, 20, 0, 3, 59, 0, time.UTC),
- gomod: "module \"github.com/rsc/vgotest1/v2\" // v2/go.mod\n",
+ vcs: "git",
+ path: "github.com/rsc/vgotest1/v2",
+ rev: "v2.0.5",
+ version: "v2.0.5",
+ name: "2f615117ce481c8efef46e0cc0b4b4dccfac8fea",
+ short: "2f615117ce48",
+ time: time.Date(2018, 2, 20, 0, 3, 59, 0, time.UTC),
+ gomod: "module \"github.com/rsc/vgotest1/v2\" // v2/go.mod\n",
+ zipSum: "h1:RIEb9q1SUSEQOzMn0zfl/LQxGFWlhWEAdeEguf1MLGU=",
+ zipFileHash: "7d92c2c328c5e9b0694101353705d5843746ec1d93a1e986d0da54c8a14dfe6d",
},
{
// redirect to github
- vcs: "git",
- path: "rsc.io/quote",
- rev: "v1.0.0",
- version: "v1.0.0",
- name: "f488df80bcdbd3e5bafdc24ad7d1e79e83edd7e6",
- short: "f488df80bcdb",
- time: time.Date(2018, 2, 14, 0, 45, 20, 0, time.UTC),
- gomod: "module \"rsc.io/quote\"\n",
+ vcs: "git",
+ path: "rsc.io/quote",
+ rev: "v1.0.0",
+ version: "v1.0.0",
+ name: "f488df80bcdbd3e5bafdc24ad7d1e79e83edd7e6",
+ short: "f488df80bcdb",
+ time: time.Date(2018, 2, 14, 0, 45, 20, 0, time.UTC),
+ gomod: "module \"rsc.io/quote\"\n",
+ zipSum: "h1:haUSojyo3j2M9g7CEUFG8Na09dtn7QKxvPGaPVQdGwM=",
+ zipFileHash: "5c08ba2c09a364f93704aaa780e7504346102c6ef4fe1333a11f09904a732078",
},
{
// redirect to static hosting proxy
@@ -281,22 +307,26 @@ var codeRepoTests = []codeRepoTest{
},
{
// redirect to googlesource
- vcs: "git",
- path: "golang.org/x/text",
- rev: "4e4a3210bb",
- version: "v0.3.1-0.20180208041248-4e4a3210bb54",
- name: "4e4a3210bb54bb31f6ab2cdca2edcc0b50c420c1",
- short: "4e4a3210bb54",
- time: time.Date(2018, 2, 8, 4, 12, 48, 0, time.UTC),
- },
- {
- vcs: "git",
- path: "github.com/pkg/errors",
- rev: "v0.8.0",
- version: "v0.8.0",
- name: "645ef00459ed84a119197bfb8d8205042c6df63d",
- short: "645ef00459ed",
- time: time.Date(2016, 9, 29, 1, 48, 1, 0, time.UTC),
+ vcs: "git",
+ path: "golang.org/x/text",
+ rev: "4e4a3210bb",
+ version: "v0.3.1-0.20180208041248-4e4a3210bb54",
+ name: "4e4a3210bb54bb31f6ab2cdca2edcc0b50c420c1",
+ short: "4e4a3210bb54",
+ time: time.Date(2018, 2, 8, 4, 12, 48, 0, time.UTC),
+ zipSum: "h1:Yxu6pHX9X2RECiuw/Q5/4uvajuaowck8zOFKXgbfNBk=",
+ zipFileHash: "ac2c165a5c10aa5a7545dea60a08e019270b982fa6c8bdcb5943931de64922fe",
+ },
+ {
+ vcs: "git",
+ path: "github.com/pkg/errors",
+ rev: "v0.8.0",
+ version: "v0.8.0",
+ name: "645ef00459ed84a119197bfb8d8205042c6df63d",
+ short: "645ef00459ed",
+ time: time.Date(2016, 9, 29, 1, 48, 1, 0, time.UTC),
+ zipSum: "h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=",
+ zipFileHash: "e4fa69ba057356614edbc1da881a7d3ebb688505be49f65965686bcb859e2fae",
},
{
// package in subdirectory - custom domain
@@ -304,7 +334,7 @@ var codeRepoTests = []codeRepoTest{
// but gopkg.in is special.
vcs: "git",
path: "gopkg.in/yaml.v2/abc",
- lookerr: "invalid module path \"gopkg.in/yaml.v2/abc\"",
+ lookErr: "invalid module path \"gopkg.in/yaml.v2/abc\"",
},
{
// package in subdirectory - github
@@ -315,54 +345,52 @@ var codeRepoTests = []codeRepoTest{
err: "missing github.com/rsc/quote/buggy/go.mod at revision c4d4236f9242",
},
{
- vcs: "git",
- path: "gopkg.in/yaml.v2",
- rev: "d670f940",
- version: "v2.0.0",
- name: "d670f9405373e636a5a2765eea47fac0c9bc91a4",
- short: "d670f9405373",
- time: time.Date(2018, 1, 9, 11, 43, 31, 0, time.UTC),
- gomod: "module gopkg.in/yaml.v2\n",
- },
- {
- vcs: "git",
- path: "gopkg.in/check.v1",
- rev: "20d25e280405",
- version: "v1.0.0-20161208181325-20d25e280405",
- name: "20d25e2804050c1cd24a7eea1e7a6447dd0e74ec",
- short: "20d25e280405",
- time: time.Date(2016, 12, 8, 18, 13, 25, 0, time.UTC),
- gomod: "module gopkg.in/check.v1\n",
- },
- {
- vcs: "git",
- path: "gopkg.in/yaml.v2",
- rev: "v2",
- version: "v2.2.3-0.20190319135612-7b8349ac747c",
- name: "7b8349ac747c6a24702b762d2c4fd9266cf4f1d6",
- short: "7b8349ac747c",
- time: time.Date(2019, 03, 19, 13, 56, 12, 0, time.UTC),
- gomod: "module \"gopkg.in/yaml.v2\"\n\nrequire (\n\t\"gopkg.in/check.v1\" v0.0.0-20161208181325-20d25e280405\n)\n",
- },
- {
- vcs: "git",
- path: "vcs-test.golang.org/go/mod/gitrepo1",
- rev: "master",
- version: "v1.2.4-annotated",
- name: "ede458df7cd0fdca520df19a33158086a8a68e81",
- short: "ede458df7cd0",
- time: time.Date(2018, 4, 17, 19, 43, 22, 0, time.UTC),
- gomod: "module vcs-test.golang.org/go/mod/gitrepo1\n",
- },
- {
- vcs: "git",
- path: "gopkg.in/natefinch/lumberjack.v2",
- rev: "latest",
- version: "v2.0.0-20170531160350-a96e63847dc3",
- name: "a96e63847dc3c67d17befa69c303767e2f84e54f",
- short: "a96e63847dc3",
- time: time.Date(2017, 5, 31, 16, 3, 50, 0, time.UTC),
- gomod: "module gopkg.in/natefinch/lumberjack.v2\n",
+ vcs: "git",
+ path: "gopkg.in/yaml.v2",
+ rev: "d670f940",
+ version: "v2.0.0",
+ name: "d670f9405373e636a5a2765eea47fac0c9bc91a4",
+ short: "d670f9405373",
+ time: time.Date(2018, 1, 9, 11, 43, 31, 0, time.UTC),
+ gomod: "module gopkg.in/yaml.v2\n",
+ zipSum: "h1:uUkhRGrsEyx/laRdeS6YIQKIys8pg+lRSRdVMTYjivs=",
+ zipFileHash: "7b0a141b1b0b49772ab4eecfd11dfd6609a94a5e868cab04a3abb1861ffaa877",
+ },
+ {
+ vcs: "git",
+ path: "gopkg.in/check.v1",
+ rev: "20d25e280405",
+ version: "v1.0.0-20161208181325-20d25e280405",
+ name: "20d25e2804050c1cd24a7eea1e7a6447dd0e74ec",
+ short: "20d25e280405",
+ time: time.Date(2016, 12, 8, 18, 13, 25, 0, time.UTC),
+ gomod: "module gopkg.in/check.v1\n",
+ zipSum: "h1:829vOVxxusYHC+IqBtkX5mbKtsY9fheQiQn0MZRVLfQ=",
+ zipFileHash: "9e7cb3f4f1e66d722306442b0dbe1f6f43d74d1736d54c510537bdfb1d6f432f",
+ },
+ {
+ vcs: "git",
+ path: "vcs-test.golang.org/go/mod/gitrepo1",
+ rev: "master",
+ version: "v1.2.4-annotated",
+ name: "ede458df7cd0fdca520df19a33158086a8a68e81",
+ short: "ede458df7cd0",
+ time: time.Date(2018, 4, 17, 19, 43, 22, 0, time.UTC),
+ gomod: "module vcs-test.golang.org/go/mod/gitrepo1\n",
+ zipSum: "h1:YJYZRsM9BHFTlVr8YADjT0cJH8uFIDtoc5NLiVqZEx8=",
+ zipFileHash: "c15e49d58b7a4c37966cbe5bc01a0330cd5f2927e990e1839bda1d407766d9c5",
+ },
+ {
+ vcs: "git",
+ path: "gopkg.in/natefinch/lumberjack.v2",
+ rev: "latest",
+ version: "v2.0.0-20170531160350-a96e63847dc3",
+ name: "a96e63847dc3c67d17befa69c303767e2f84e54f",
+ short: "a96e63847dc3",
+ time: time.Date(2017, 5, 31, 16, 3, 50, 0, time.UTC),
+ gomod: "module gopkg.in/natefinch/lumberjack.v2\n",
+ zipSum: "h1:AFxeG48hTWHhDTQDk/m2gorfVHUEa9vo3tp3D7TzwjI=",
+ zipFileHash: "b5de0da7bbbec76709eef1ac71b6c9ff423b9fbf3bb97b56743450d4937b06d5",
},
{
vcs: "git",
@@ -381,14 +409,16 @@ var codeRepoTests = []codeRepoTest{
gomod: "module gopkg.in/natefinch/lumberjack.v2\n",
},
{
- vcs: "git",
- path: "vcs-test.golang.org/go/v2module/v2",
- rev: "v2.0.0",
- version: "v2.0.0",
- name: "203b91c896acd173aa719e4cdcb7d463c4b090fa",
- short: "203b91c896ac",
- time: time.Date(2019, 4, 3, 15, 52, 15, 0, time.UTC),
- gomod: "module vcs-test.golang.org/go/v2module/v2\n\ngo 1.12\n",
+ vcs: "git",
+ path: "vcs-test.golang.org/go/v2module/v2",
+ rev: "v2.0.0",
+ version: "v2.0.0",
+ name: "203b91c896acd173aa719e4cdcb7d463c4b090fa",
+ short: "203b91c896ac",
+ time: time.Date(2019, 4, 3, 15, 52, 15, 0, time.UTC),
+ gomod: "module vcs-test.golang.org/go/v2module/v2\n\ngo 1.12\n",
+ zipSum: "h1:JItBZ+gwA5WvtZEGEbuDL4lUttGtLrs53lmdurq3bOg=",
+ zipFileHash: "9ea9ae1673cffcc44b7fdd3cc89953d68c102449b46c982dbf085e4f2e394da5",
},
}
@@ -411,21 +441,23 @@ func TestCodeRepo(t *testing.T) {
}
repo, err := Lookup("direct", tt.path)
- if tt.lookerr != "" {
- if err != nil && err.Error() == tt.lookerr {
+ if tt.lookErr != "" {
+ if err != nil && err.Error() == tt.lookErr {
return
}
- t.Errorf("Lookup(%q): %v, want error %q", tt.path, err, tt.lookerr)
+ t.Errorf("Lookup(%q): %v, want error %q", tt.path, err, tt.lookErr)
}
if err != nil {
t.Fatalf("Lookup(%q): %v", tt.path, err)
}
+
if tt.mpath == "" {
tt.mpath = tt.path
}
if mpath := repo.ModulePath(); mpath != tt.mpath {
t.Errorf("repo.ModulePath() = %q, want %q", mpath, tt.mpath)
}
+
info, err := repo.Stat(tt.rev)
if err != nil {
if tt.err != "" {
@@ -451,56 +483,86 @@ func TestCodeRepo(t *testing.T) {
if !info.Time.Equal(tt.time) {
t.Errorf("info.Time = %v, want %v", info.Time, tt.time)
}
- if tt.gomod != "" || tt.gomoderr != "" {
+
+ if tt.gomod != "" || tt.gomodErr != "" {
data, err := repo.GoMod(tt.version)
- if err != nil && tt.gomoderr == "" {
+ if err != nil && tt.gomodErr == "" {
t.Errorf("repo.GoMod(%q): %v", tt.version, err)
- } else if err != nil && tt.gomoderr != "" {
- if err.Error() != tt.gomoderr {
- t.Errorf("repo.GoMod(%q): %v, want %q", tt.version, err, tt.gomoderr)
+ } else if err != nil && tt.gomodErr != "" {
+ if err.Error() != tt.gomodErr {
+ t.Errorf("repo.GoMod(%q): %v, want %q", tt.version, err, tt.gomodErr)
}
- } else if tt.gomoderr != "" {
- t.Errorf("repo.GoMod(%q) = %q, want error %q", tt.version, data, tt.gomoderr)
+ } else if tt.gomodErr != "" {
+ t.Errorf("repo.GoMod(%q) = %q, want error %q", tt.version, data, tt.gomodErr)
} else if string(data) != tt.gomod {
t.Errorf("repo.GoMod(%q) = %q, want %q", tt.version, data, tt.gomod)
}
}
- if tt.zip != nil || tt.ziperr != "" {
+
+ needHash := !testing.Short() && (tt.zipFileHash != "" || tt.zipSum != "")
+ if tt.zip != nil || tt.zipErr != "" || needHash {
f, err := ioutil.TempFile(tmpdir, tt.version+".zip.")
if err != nil {
t.Fatalf("ioutil.TempFile: %v", err)
}
zipfile := f.Name()
- err = repo.Zip(f, tt.version)
+ defer func() {
+ f.Close()
+ os.Remove(zipfile)
+ }()
+
+ var w io.Writer
+ var h hash.Hash
+ if needHash {
+ h = sha256.New()
+ w = io.MultiWriter(f, h)
+ } else {
+ w = f
+ }
+ err = repo.Zip(w, tt.version)
f.Close()
if err != nil {
- if tt.ziperr != "" {
- if err.Error() == tt.ziperr {
+ if tt.zipErr != "" {
+ if err.Error() == tt.zipErr {
return
}
- t.Fatalf("repo.Zip(%q): %v, want error %q", tt.version, err, tt.ziperr)
+ t.Fatalf("repo.Zip(%q): %v, want error %q", tt.version, err, tt.zipErr)
}
t.Fatalf("repo.Zip(%q): %v", tt.version, err)
}
- if tt.ziperr != "" {
- t.Errorf("repo.Zip(%q): success, want error %q", tt.version, tt.ziperr)
- }
- prefix := tt.path + "@" + tt.version + "/"
- z, err := zip.OpenReader(zipfile)
- if err != nil {
- t.Fatalf("open zip %s: %v", zipfile, err)
+ if tt.zipErr != "" {
+ t.Errorf("repo.Zip(%q): success, want error %q", tt.version, tt.zipErr)
}
- var names []string
- for _, file := range z.File {
- if !strings.HasPrefix(file.Name, prefix) {
- t.Errorf("zip entry %v does not start with prefix %v", file.Name, prefix)
- continue
+
+ if tt.zip != nil {
+ prefix := tt.path + "@" + tt.version + "/"
+ z, err := zip.OpenReader(zipfile)
+ if err != nil {
+ t.Fatalf("open zip %s: %v", zipfile, err)
+ }
+ var names []string
+ for _, file := range z.File {
+ if !strings.HasPrefix(file.Name, prefix) {
+ t.Errorf("zip entry %v does not start with prefix %v", file.Name, prefix)
+ continue
+ }
+ names = append(names, file.Name[len(prefix):])
+ }
+ z.Close()
+ if !reflect.DeepEqual(names, tt.zip) {
+ t.Fatalf("zip = %v\nwant %v\n", names, tt.zip)
}
- names = append(names, file.Name[len(prefix):])
}
- z.Close()
- if !reflect.DeepEqual(names, tt.zip) {
- t.Fatalf("zip = %v\nwant %v\n", names, tt.zip)
+
+ if needHash {
+ sum, err := dirhash.HashZip(zipfile, dirhash.Hash1)
+ if err != nil {
+ t.Errorf("repo.Zip(%q): %v", tt.version, err)
+ } else if sum != tt.zipSum {
+ t.Errorf("repo.Zip(%q): got file with sum %q, want %q", tt.version, sum, tt.zipSum)
+ } else if zipFileHash := hex.EncodeToString(h.Sum(nil)); zipFileHash != tt.zipFileHash {
+ t.Errorf("repo.Zip(%q): got file with hash %q, want %q (but content has correct sum)", tt.version, zipFileHash, tt.zipFileHash)
+ }
}
}
}
@@ -508,26 +570,26 @@ func TestCodeRepo(t *testing.T) {
t.Run(strings.ReplaceAll(tt.path, "/", "_")+"/"+tt.rev, f(tt))
if strings.HasPrefix(tt.path, vgotest1git) {
for vcs, alt := range altVgotests {
- // Note: Communicating with f through tt; should be cleaned up.
- old := tt
- tt.vcs = vcs
- tt.path = alt + strings.TrimPrefix(tt.path, vgotest1git)
- if strings.HasPrefix(tt.mpath, vgotest1git) {
- tt.mpath = alt + strings.TrimPrefix(tt.mpath, vgotest1git)
+ altTest := tt
+ altTest.vcs = vcs
+ altTest.path = alt + strings.TrimPrefix(altTest.path, vgotest1git)
+ if strings.HasPrefix(altTest.mpath, vgotest1git) {
+ altTest.mpath = alt + strings.TrimPrefix(altTest.mpath, vgotest1git)
}
var m map[string]string
if alt == vgotest1hg {
m = hgmap
}
- tt.version = remap(tt.version, m)
- tt.name = remap(tt.name, m)
- tt.short = remap(tt.short, m)
- tt.rev = remap(tt.rev, m)
- tt.err = remap(tt.err, m)
- tt.gomoderr = remap(tt.gomoderr, m)
- tt.ziperr = remap(tt.ziperr, m)
- t.Run(strings.ReplaceAll(tt.path, "/", "_")+"/"+tt.rev, f(tt))
- tt = old
+ altTest.version = remap(altTest.version, m)
+ altTest.name = remap(altTest.name, m)
+ altTest.short = remap(altTest.short, m)
+ altTest.rev = remap(altTest.rev, m)
+ altTest.err = remap(altTest.err, m)
+ altTest.gomodErr = remap(altTest.gomodErr, m)
+ altTest.zipErr = remap(altTest.zipErr, m)
+ altTest.zipSum = ""
+ altTest.zipFileHash = ""
+ t.Run(strings.ReplaceAll(altTest.path, "/", "_")+"/"+altTest.rev, f(altTest))
}
}
}
@@ -575,7 +637,7 @@ var codeRepoVersionsTests = []struct {
{
vcs: "git",
path: "github.com/rsc/vgotest1",
- versions: []string{"v0.0.0", "v0.0.1", "v1.0.0", "v1.0.1", "v1.0.2", "v1.0.3", "v1.1.0", "v2.0.0+incompatible"},
+ versions: []string{"v0.0.0", "v0.0.1", "v1.0.0", "v1.0.1", "v1.0.2", "v1.0.3", "v1.1.0"},
},
{
vcs: "git",
diff --git a/libgo/go/cmd/go/internal/modfetch/fetch.go b/libgo/go/cmd/go/internal/modfetch/fetch.go
index 51a56028c4a..54fbd92b43e 100644
--- a/libgo/go/cmd/go/internal/modfetch/fetch.go
+++ b/libgo/go/cmd/go/internal/modfetch/fetch.go
@@ -7,6 +7,7 @@ package modfetch
import (
"archive/zip"
"bytes"
+ "errors"
"fmt"
"io"
"io/ioutil"
@@ -18,10 +19,13 @@ import (
"cmd/go/internal/base"
"cmd/go/internal/cfg"
- "cmd/go/internal/dirhash"
- "cmd/go/internal/module"
+ "cmd/go/internal/lockedfile"
"cmd/go/internal/par"
"cmd/go/internal/renameio"
+
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/sumdb/dirhash"
+ modzip "golang.org/x/mod/zip"
)
var downloadCache par.Cache
@@ -69,10 +73,6 @@ func download(mod module.Version, dir string) (err error) {
return err
}
- if cfg.CmdName != "mod download" {
- fmt.Fprintf(os.Stderr, "go: extracting %s %s\n", mod.Path, mod.Version)
- }
-
unlock, err := lockVersion(mod)
if err != nil {
return err
@@ -114,8 +114,7 @@ func download(mod module.Version, dir string) (err error) {
}
}()
- modpath := mod.Path + "@" + mod.Version
- if err := Unzip(tmpDir, zipfile, modpath, 0); err != nil {
+ if err := modzip.Unzip(tmpDir, mod, zipfile); err != nil {
fmt.Fprintf(os.Stderr, "-> %s\n", err)
return err
}
@@ -124,9 +123,11 @@ func download(mod module.Version, dir string) (err error) {
return err
}
- // Make dir read-only only *after* renaming it.
- // os.Rename was observed to fail for read-only directories on macOS.
- makeDirsReadOnly(dir)
+ if !cfg.ModCacheRW {
+ // Make dir read-only only *after* renaming it.
+ // os.Rename was observed to fail for read-only directories on macOS.
+ makeDirsReadOnly(dir)
+ }
return nil
}
@@ -249,7 +250,9 @@ func downloadZip(mod module.Version, zipfile string) (err error) {
if err != nil {
return err
}
- checkModSum(mod, hash)
+ if err := checkModSum(mod, hash); err != nil {
+ return err
+ }
if err := renameio.WriteFile(zipfile+"hash", []byte(hash), 0666); err != nil {
return err
@@ -263,6 +266,45 @@ func downloadZip(mod module.Version, zipfile string) (err error) {
return nil
}
+// makeDirsReadOnly makes a best-effort attempt to remove write permissions for dir
+// and its transitive contents.
+func makeDirsReadOnly(dir string) {
+ type pathMode struct {
+ path string
+ mode os.FileMode
+ }
+ var dirs []pathMode // in lexical order
+ filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
+ if err == nil && info.Mode()&0222 != 0 {
+ if info.IsDir() {
+ dirs = append(dirs, pathMode{path, info.Mode()})
+ }
+ }
+ return nil
+ })
+
+ // Run over list backward to chmod children before parents.
+ for i := len(dirs) - 1; i >= 0; i-- {
+ os.Chmod(dirs[i].path, dirs[i].mode&^0222)
+ }
+}
+
+// RemoveAll removes a directory written by Download or Unzip, first applying
+// any permission changes needed to do so.
+func RemoveAll(dir string) error {
+ // Module cache has 0555 directories; make them writable in order to remove content.
+ filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
+ if err != nil {
+ return nil // ignore errors walking in file system
+ }
+ if info.IsDir() {
+ os.Chmod(path, 0777)
+ }
+ return nil
+ })
+ return os.RemoveAll(dir)
+}
+
var GoSumFile string // path to go.sum; set by package modload
type modSum struct {
@@ -281,21 +323,22 @@ var goSum struct {
}
// initGoSum initializes the go.sum data.
-// It reports whether use of go.sum is now enabled.
+// The boolean it returns reports whether the
+// use of go.sum is now enabled.
// The goSum lock must be held.
-func initGoSum() bool {
+func initGoSum() (bool, error) {
if GoSumFile == "" {
- return false
+ return false, nil
}
if goSum.m != nil {
- return true
+ return true, nil
}
goSum.m = make(map[module.Version][]string)
goSum.checked = make(map[modSum]bool)
- data, err := renameio.ReadFile(GoSumFile)
+ data, err := lockedfile.Read(GoSumFile)
if err != nil && !os.IsNotExist(err) {
- base.Fatalf("go: %v", err)
+ return false, err
}
goSum.enabled = true
readGoSum(goSum.m, GoSumFile, data)
@@ -313,7 +356,7 @@ func initGoSum() bool {
}
goSum.modverify = alt
}
- return true
+ return true, nil
}
// emptyGoModHash is the hash of a 1-file tree containing a 0-length go.mod.
@@ -323,7 +366,7 @@ const emptyGoModHash = "h1:G7mAYYxgmS0lVkHyy2hEOLQCFB0DlQFTMLWggykrydY="
// readGoSum parses data, which is the content of file,
// and adds it to goSum.m. The goSum lock must be held.
-func readGoSum(dst map[module.Version][]string, file string, data []byte) {
+func readGoSum(dst map[module.Version][]string, file string, data []byte) error {
lineno := 0
for len(data) > 0 {
var line []byte
@@ -340,7 +383,7 @@ func readGoSum(dst map[module.Version][]string, file string, data []byte) {
continue
}
if len(f) != 3 {
- base.Fatalf("go: malformed go.sum:\n%s:%d: wrong number of fields %v", file, lineno, len(f))
+ return fmt.Errorf("malformed go.sum:\n%s:%d: wrong number of fields %v", file, lineno, len(f))
}
if f[2] == emptyGoModHash {
// Old bug; drop it.
@@ -349,6 +392,7 @@ func readGoSum(dst map[module.Version][]string, file string, data []byte) {
mod := module.Version{Path: f[0], Version: f[1]}
dst[mod] = append(dst[mod], f[2])
}
+ return nil
}
// checkMod checks the given module's checksum.
@@ -361,22 +405,24 @@ func checkMod(mod module.Version) {
// Do the file I/O before acquiring the go.sum lock.
ziphash, err := CachePath(mod, "ziphash")
if err != nil {
- base.Fatalf("verifying %s@%s: %v", mod.Path, mod.Version, err)
+ base.Fatalf("verifying %v", module.VersionError(mod, err))
}
data, err := renameio.ReadFile(ziphash)
if err != nil {
- if os.IsNotExist(err) {
+ if errors.Is(err, os.ErrNotExist) {
// This can happen if someone does rm -rf GOPATH/src/cache/download. So it goes.
return
}
- base.Fatalf("verifying %s@%s: %v", mod.Path, mod.Version, err)
+ base.Fatalf("verifying %v", module.VersionError(mod, err))
}
h := strings.TrimSpace(string(data))
if !strings.HasPrefix(h, "h1:") {
- base.Fatalf("verifying %s@%s: unexpected ziphash: %q", mod.Path, mod.Version, h)
+ base.Fatalf("verifying %v", module.VersionError(mod, fmt.Errorf("unexpected ziphash: %q", h)))
}
- checkModSum(mod, h)
+ if err := checkModSum(mod, h); err != nil {
+ base.Fatalf("%s", err)
+ }
}
// goModSum returns the checksum for the go.mod contents.
@@ -388,17 +434,17 @@ func goModSum(data []byte) (string, error) {
// checkGoMod checks the given module's go.mod checksum;
// data is the go.mod content.
-func checkGoMod(path, version string, data []byte) {
+func checkGoMod(path, version string, data []byte) error {
h, err := goModSum(data)
if err != nil {
- base.Fatalf("verifying %s %s go.mod: %v", path, version, err)
+ return &module.ModuleError{Path: path, Version: version, Err: fmt.Errorf("verifying go.mod: %v", err)}
}
- checkModSum(module.Version{Path: path, Version: version + "/go.mod"}, h)
+ return checkModSum(module.Version{Path: path, Version: version + "/go.mod"}, h)
}
// checkModSum checks that the recorded checksum for mod is h.
-func checkModSum(mod module.Version, h string) {
+func checkModSum(mod module.Version, h string) error {
// We lock goSum when manipulating it,
// but we arrange to release the lock when calling checkSumDB,
// so that parallel calls to checkModHash can execute parallel calls
@@ -406,19 +452,24 @@ func checkModSum(mod module.Version, h string) {
// Check whether mod+h is listed in go.sum already. If so, we're done.
goSum.mu.Lock()
- inited := initGoSum()
+ inited, err := initGoSum()
+ if err != nil {
+ return err
+ }
done := inited && haveModSumLocked(mod, h)
goSum.mu.Unlock()
if done {
- return
+ return nil
}
// Not listed, so we want to add them.
// Consult checksum database if appropriate.
if useSumDB(mod) {
// Calls base.Fatalf if mismatch detected.
- checkSumDB(mod, h)
+ if err := checkSumDB(mod, h); err != nil {
+ return err
+ }
}
// Add mod+h to go.sum, if it hasn't appeared already.
@@ -427,6 +478,7 @@ func checkModSum(mod module.Version, h string) {
addModSumLocked(mod, h)
goSum.mu.Unlock()
}
+ return nil
}
// haveModSumLocked reports whether the pair mod,h is already listed in go.sum.
@@ -460,22 +512,23 @@ func addModSumLocked(mod module.Version, h string) {
// checkSumDB checks the mod, h pair against the Go checksum database.
// It calls base.Fatalf if the hash is to be rejected.
-func checkSumDB(mod module.Version, h string) {
+func checkSumDB(mod module.Version, h string) error {
db, lines, err := lookupSumDB(mod)
if err != nil {
- base.Fatalf("verifying %s@%s: %v", mod.Path, mod.Version, err)
+ return module.VersionError(mod, fmt.Errorf("verifying module: %v", err))
}
have := mod.Path + " " + mod.Version + " " + h
prefix := mod.Path + " " + mod.Version + " h1:"
for _, line := range lines {
if line == have {
- return
+ return nil
}
if strings.HasPrefix(line, prefix) {
- base.Fatalf("verifying %s@%s: checksum mismatch\n\tdownloaded: %v\n\t%s: %v"+sumdbMismatch, mod.Path, mod.Version, h, db, line[len(prefix)-len("h1:"):])
+ return module.VersionError(mod, fmt.Errorf("verifying module: checksum mismatch\n\tdownloaded: %v\n\t%s: %v"+sumdbMismatch, h, db, line[len(prefix)-len("h1:"):]))
}
}
+ return nil
}
// Sum returns the checksum for the downloaded copy of the given module,
@@ -516,60 +569,45 @@ func WriteGoSum() {
base.Fatalf("go: updates to go.sum needed, disabled by -mod=readonly")
}
- // We want to avoid races between creating the lockfile and deleting it, but
- // we also don't want to leave a permanent lockfile in the user's repository.
- //
- // On top of that, if we crash while writing go.sum, we don't want to lose the
- // sums that were already present in the file, so it's important that we write
- // the file by renaming rather than truncating — which means that we can't
- // lock the go.sum file itself.
- //
- // Instead, we'll lock a distinguished file in the cache directory: that will
- // only race if the user runs `go clean -modcache` concurrently with a command
- // that updates go.sum, and that's already racy to begin with.
- //
- // We'll end up slightly over-synchronizing go.sum writes if the user runs a
- // bunch of go commands that update sums in separate modules simultaneously,
- // but that's unlikely to matter in practice.
-
- unlock := SideLock()
- defer unlock()
+ // Make a best-effort attempt to acquire the side lock, only to exclude
+ // previous versions of the 'go' command from making simultaneous edits.
+ if unlock, err := SideLock(); err == nil {
+ defer unlock()
+ }
- if !goSum.overwrite {
- // Re-read the go.sum file to incorporate any sums added by other processes
- // in the meantime.
- data, err := renameio.ReadFile(GoSumFile)
- if err != nil && !os.IsNotExist(err) {
- base.Fatalf("go: re-reading go.sum: %v", err)
- }
-
- // Add only the sums that we actually checked: the user may have edited or
- // truncated the file to remove erroneous hashes, and we shouldn't restore
- // them without good reason.
- goSum.m = make(map[module.Version][]string, len(goSum.m))
- readGoSum(goSum.m, GoSumFile, data)
- for ms := range goSum.checked {
- addModSumLocked(ms.mod, ms.sum)
- goSum.dirty = true
+ err := lockedfile.Transform(GoSumFile, func(data []byte) ([]byte, error) {
+ if !goSum.overwrite {
+ // Incorporate any sums added by other processes in the meantime.
+ // Add only the sums that we actually checked: the user may have edited or
+ // truncated the file to remove erroneous hashes, and we shouldn't restore
+ // them without good reason.
+ goSum.m = make(map[module.Version][]string, len(goSum.m))
+ readGoSum(goSum.m, GoSumFile, data)
+ for ms := range goSum.checked {
+ addModSumLocked(ms.mod, ms.sum)
+ goSum.dirty = true
+ }
}
- }
- var mods []module.Version
- for m := range goSum.m {
- mods = append(mods, m)
- }
- module.Sort(mods)
- var buf bytes.Buffer
- for _, m := range mods {
- list := goSum.m[m]
- sort.Strings(list)
- for _, h := range list {
- fmt.Fprintf(&buf, "%s %s %s\n", m.Path, m.Version, h)
+ var mods []module.Version
+ for m := range goSum.m {
+ mods = append(mods, m)
}
- }
+ module.Sort(mods)
+
+ var buf bytes.Buffer
+ for _, m := range mods {
+ list := goSum.m[m]
+ sort.Strings(list)
+ for _, h := range list {
+ fmt.Fprintf(&buf, "%s %s %s\n", m.Path, m.Version, h)
+ }
+ }
+ return buf.Bytes(), nil
+ })
- if err := renameio.WriteFile(GoSumFile, buf.Bytes(), 0666); err != nil {
- base.Fatalf("go: writing go.sum: %v", err)
+ if err != nil {
+ base.Fatalf("go: updating go.sum: %v", err)
}
goSum.checked = make(map[modSum]bool)
@@ -585,7 +623,11 @@ func WriteGoSum() {
func TrimGoSum(keep map[module.Version]bool) {
goSum.mu.Lock()
defer goSum.mu.Unlock()
- if !initGoSum() {
+ inited, err := initGoSum()
+ if err != nil {
+ base.Fatalf("%s", err)
+ }
+ if !inited {
return
}
diff --git a/libgo/go/cmd/go/internal/modfetch/insecure.go b/libgo/go/cmd/go/internal/modfetch/insecure.go
new file mode 100644
index 00000000000..8420432d6cd
--- /dev/null
+++ b/libgo/go/cmd/go/internal/modfetch/insecure.go
@@ -0,0 +1,16 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package modfetch
+
+import (
+ "cmd/go/internal/cfg"
+ "cmd/go/internal/get"
+ "cmd/go/internal/str"
+)
+
+// allowInsecure reports whether we are allowed to fetch this path in an insecure manner.
+func allowInsecure(path string) bool {
+ return get.Insecure || str.GlobsMatchPath(cfg.GOINSECURE, path)
+}
diff --git a/libgo/go/cmd/go/internal/modfetch/proxy.go b/libgo/go/cmd/go/internal/modfetch/proxy.go
index 569ef3a57a6..dcea71adb3a 100644
--- a/libgo/go/cmd/go/internal/modfetch/proxy.go
+++ b/libgo/go/cmd/go/internal/modfetch/proxy.go
@@ -22,9 +22,10 @@ import (
"cmd/go/internal/base"
"cmd/go/internal/cfg"
"cmd/go/internal/modfetch/codehost"
- "cmd/go/internal/module"
- "cmd/go/internal/semver"
"cmd/go/internal/web"
+
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
)
var HelpGoproxy = &base.Command{
@@ -38,8 +39,8 @@ can be a module proxy.
The GET requests sent to a Go module proxy are:
-GET $GOPROXY/<module>/@v/list returns a list of all known versions of the
-given module, one per line.
+GET $GOPROXY/<module>/@v/list returns a list of known versions of the given
+module, one per line.
GET $GOPROXY/<module>/@v/<version>.info returns JSON-formatted metadata
about that version of the given module.
@@ -50,6 +51,21 @@ for that version of the given module.
GET $GOPROXY/<module>/@v/<version>.zip returns the zip archive
for that version of the given module.
+GET $GOPROXY/<module>/@latest returns JSON-formatted metadata about the
+latest known version of the given module in the same format as
+<module>/@v/<version>.info. The latest version should be the version of
+the module the go command may use if <module>/@v/list is empty or no
+listed version is suitable. <module>/@latest is optional and may not
+be implemented by a module proxy.
+
+When resolving the latest version of a module, the go command will request
+<module>/@v/list, then, if no suitable versions are found, <module>/@latest.
+The go command prefers, in order: the semantically highest release version,
+the semantically highest pre-release version, and the chronologically
+most recent pseudo-version. In Go 1.12 and earlier, the go command considered
+pseudo-versions in <module>/@v/list to be pre-release versions, but this is
+no longer true since Go 1.13.
+
To avoid problems when serving from case-sensitive file systems,
the <module> and <version> elements are case-encoded, replacing every
uppercase letter with an exclamation mark followed by the corresponding
@@ -150,13 +166,28 @@ func TryProxies(f func(proxy string) error) error {
return f("off")
}
+ var lastAttemptErr error
for _, proxy := range proxies {
err = f(proxy)
if !errors.Is(err, os.ErrNotExist) {
+ lastAttemptErr = err
break
}
+
+ // The error indicates that the module does not exist.
+ // In general we prefer to report the last such error,
+ // because it indicates the error that occurs after all other
+ // options have been exhausted.
+ //
+ // However, for modules in the NOPROXY list, the most useful error occurs
+ // first (with proxy set to "noproxy"), and the subsequent errors are all
+ // errNoProxy (which is not particularly helpful). Do not overwrite a more
+ // useful error with errNoproxy.
+ if lastAttemptErr == nil || !errors.Is(err, errNoproxy) {
+ lastAttemptErr = err
+ }
}
- return err
+ return lastAttemptErr
}
type proxyRepo struct {
@@ -182,7 +213,7 @@ func newProxyRepo(baseURL, path string) (Repo, error) {
return nil, fmt.Errorf("invalid proxy URL scheme (must be https, http, file): %s", web.Redacted(base))
}
- enc, err := module.EncodePath(path)
+ enc, err := module.EscapePath(path)
if err != nil {
return nil, err
}
@@ -321,7 +352,7 @@ func (p *proxyRepo) latest() (*RevInfo, error) {
}
func (p *proxyRepo) Stat(rev string) (*RevInfo, error) {
- encRev, err := module.EncodeVersion(rev)
+ encRev, err := module.EscapeVersion(rev)
if err != nil {
return nil, p.versionError(rev, err)
}
@@ -362,7 +393,7 @@ func (p *proxyRepo) GoMod(version string) ([]byte, error) {
return nil, p.versionError(version, fmt.Errorf("internal error: version passed to GoMod is not canonical"))
}
- encVer, err := module.EncodeVersion(version)
+ encVer, err := module.EscapeVersion(version)
if err != nil {
return nil, p.versionError(version, err)
}
@@ -378,7 +409,7 @@ func (p *proxyRepo) Zip(dst io.Writer, version string) error {
return p.versionError(version, fmt.Errorf("internal error: version passed to Zip is not canonical"))
}
- encVer, err := module.EncodeVersion(version)
+ encVer, err := module.EscapeVersion(version)
if err != nil {
return p.versionError(version, err)
}
diff --git a/libgo/go/cmd/go/internal/modfetch/pseudo.go b/libgo/go/cmd/go/internal/modfetch/pseudo.go
index 8c063b9107f..57dee11d071 100644
--- a/libgo/go/cmd/go/internal/modfetch/pseudo.go
+++ b/libgo/go/cmd/go/internal/modfetch/pseudo.go
@@ -40,9 +40,10 @@ import (
"strings"
"time"
- "cmd/go/internal/module"
- "cmd/go/internal/semver"
"internal/lazyregexp"
+
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
)
var pseudoVersionRE = lazyregexp.New(`^v[0-9]+\.(0\.0-|\d+\.\d+-([^+]*\.)?0\.)\d{14}-[A-Za-z0-9]+(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$`)
diff --git a/libgo/go/cmd/go/internal/modfetch/repo.go b/libgo/go/cmd/go/internal/modfetch/repo.go
index be52a8dc11f..f03bdd8d038 100644
--- a/libgo/go/cmd/go/internal/modfetch/repo.go
+++ b/libgo/go/cmd/go/internal/modfetch/repo.go
@@ -5,7 +5,6 @@
package modfetch
import (
- "errors"
"fmt"
"io"
"os"
@@ -17,9 +16,10 @@ import (
"cmd/go/internal/get"
"cmd/go/internal/modfetch/codehost"
"cmd/go/internal/par"
- "cmd/go/internal/semver"
"cmd/go/internal/str"
web "cmd/go/internal/web"
+
+ "golang.org/x/mod/semver"
)
const traceRepo = false // trace all repo actions, for debugging
@@ -34,7 +34,7 @@ type Repo interface {
// Pseudo-versions are not included.
// Versions should be returned sorted in semver order
// (implementations can use SortVersions).
- Versions(prefix string) (tags []string, err error)
+ Versions(prefix string) ([]string, error)
// Stat returns information about the revision rev.
// A revision can be any identifier known to the underlying service:
@@ -55,7 +55,7 @@ type Repo interface {
// A Rev describes a single revision in a module repository.
type RevInfo struct {
- Version string // version string
+ Version string // suggested version string for this revision
Time time.Time // commit time
// These fields are used for Stat of arbitrary rev,
@@ -214,7 +214,7 @@ func Lookup(proxy, path string) (Repo, error) {
// lookup returns the module with the given module path.
func lookup(proxy, path string) (r Repo, err error) {
if cfg.BuildMod == "vendor" {
- return nil, errModVendor
+ return nil, errLookupDisabled
}
if str.GlobsMatchPath(cfg.GONOPROXY, path) {
@@ -238,22 +238,33 @@ func lookup(proxy, path string) (r Repo, err error) {
}
}
+type lookupDisabledError struct{}
+
+func (lookupDisabledError) Error() string {
+ if cfg.BuildModReason == "" {
+ return fmt.Sprintf("module lookup disabled by -mod=%s", cfg.BuildMod)
+ }
+ return fmt.Sprintf("module lookup disabled by -mod=%s\n\t(%s)", cfg.BuildMod, cfg.BuildModReason)
+}
+
+var errLookupDisabled error = lookupDisabledError{}
+
var (
- errModVendor = errors.New("module lookup disabled by -mod=vendor")
- errProxyOff = notExistError("module lookup disabled by GOPROXY=off")
- errNoproxy error = notExistError("disabled by GOPRIVATE/GONOPROXY")
- errUseProxy error = notExistError("path does not match GOPRIVATE/GONOPROXY")
+ errProxyOff = notExistErrorf("module lookup disabled by GOPROXY=off")
+ errNoproxy error = notExistErrorf("disabled by GOPRIVATE/GONOPROXY")
+ errUseProxy error = notExistErrorf("path does not match GOPRIVATE/GONOPROXY")
)
func lookupDirect(path string) (Repo, error) {
security := web.SecureOnly
- if get.Insecure {
+
+ if allowInsecure(path) {
security = web.Insecure
}
rr, err := get.RepoRootForImportPath(path, get.PreferMod, security)
if err != nil {
// We don't know where to find code for a module with this path.
- return nil, notExistError(err.Error())
+ return nil, notExistError{err: err}
}
if rr.VCS == "mod" {
@@ -292,7 +303,7 @@ func ImportRepoRev(path, rev string) (Repo, *RevInfo, error) {
// version control system, we ignore meta tags about modules
// and use only direct source control entries (get.IgnoreMod).
security := web.SecureOnly
- if get.Insecure {
+ if allowInsecure(path) {
security = web.Insecure
}
rr, err := get.RepoRootForImportPath(path, get.IgnoreMod, security)
@@ -397,11 +408,22 @@ func (l *loggingRepo) Zip(dst io.Writer, version string) error {
}
// A notExistError is like os.ErrNotExist, but with a custom message
-type notExistError string
+type notExistError struct {
+ err error
+}
+
+func notExistErrorf(format string, args ...interface{}) error {
+ return notExistError{fmt.Errorf(format, args...)}
+}
func (e notExistError) Error() string {
- return string(e)
+ return e.err.Error()
}
+
func (notExistError) Is(target error) bool {
return target == os.ErrNotExist
}
+
+func (e notExistError) Unwrap() error {
+ return e.err
+}
diff --git a/libgo/go/cmd/go/internal/modfetch/sumdb.go b/libgo/go/cmd/go/internal/modfetch/sumdb.go
index 1c24ec273b5..1ed71dfb85c 100644
--- a/libgo/go/cmd/go/internal/modfetch/sumdb.go
+++ b/libgo/go/cmd/go/internal/modfetch/sumdb.go
@@ -24,11 +24,11 @@ import (
"cmd/go/internal/cfg"
"cmd/go/internal/get"
"cmd/go/internal/lockedfile"
- "cmd/go/internal/module"
- "cmd/go/internal/note"
"cmd/go/internal/str"
- "cmd/go/internal/sumweb"
"cmd/go/internal/web"
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/sumdb"
+ "golang.org/x/mod/sumdb/note"
)
// useSumDB reports whether to use the Go checksum database for the given module.
@@ -52,11 +52,11 @@ func lookupSumDB(mod module.Version) (dbname string, lines []string, err error)
var (
dbOnce sync.Once
dbName string
- db *sumweb.Conn
+ db *sumdb.Client
dbErr error
)
-func dbDial() (dbName string, db *sumweb.Conn, err error) {
+func dbDial() (dbName string, db *sumdb.Client, err error) {
// $GOSUMDB can be "key" or "key url",
// and the key can be a full verifier key
// or a host on our list of known keys.
@@ -106,7 +106,7 @@ func dbDial() (dbName string, db *sumweb.Conn, err error) {
base = u
}
- return name, sumweb.NewConn(&dbClient{key: key[0], name: name, direct: direct, base: base}), nil
+ return name, sumdb.NewClient(&dbClient{key: key[0], name: name, direct: direct, base: base}), nil
}
type dbClient struct {
@@ -227,7 +227,7 @@ func (*dbClient) WriteConfig(file string, old, new []byte) error {
return err
}
if len(data) > 0 && !bytes.Equal(data, old) {
- return sumweb.ErrWriteConflict
+ return sumdb.ErrWriteConflict
}
if _, err := f.Seek(0, 0); err != nil {
return err
diff --git a/libgo/go/cmd/go/internal/modfetch/unzip.go b/libgo/go/cmd/go/internal/modfetch/unzip.go
deleted file mode 100644
index ac13ede257b..00000000000
--- a/libgo/go/cmd/go/internal/modfetch/unzip.go
+++ /dev/null
@@ -1,173 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package modfetch
-
-import (
- "archive/zip"
- "fmt"
- "io"
- "io/ioutil"
- "os"
- "path"
- "path/filepath"
- "strings"
-
- "cmd/go/internal/modfetch/codehost"
- "cmd/go/internal/module"
- "cmd/go/internal/str"
-)
-
-func Unzip(dir, zipfile, prefix string, maxSize int64) error {
- // TODO(bcmills): The maxSize parameter is invariantly 0. Remove it.
- if maxSize == 0 {
- maxSize = codehost.MaxZipFile
- }
-
- // Directory can exist, but must be empty.
- files, _ := ioutil.ReadDir(dir)
- if len(files) > 0 {
- return fmt.Errorf("target directory %v exists and is not empty", dir)
- }
- if err := os.MkdirAll(dir, 0777); err != nil {
- return err
- }
-
- f, err := os.Open(zipfile)
- if err != nil {
- return err
- }
- defer f.Close()
- info, err := f.Stat()
- if err != nil {
- return err
- }
-
- z, err := zip.NewReader(f, info.Size())
- if err != nil {
- return fmt.Errorf("unzip %v: %s", zipfile, err)
- }
-
- foldPath := make(map[string]string)
- var checkFold func(string) error
- checkFold = func(name string) error {
- fold := str.ToFold(name)
- if foldPath[fold] == name {
- return nil
- }
- dir := path.Dir(name)
- if dir != "." {
- if err := checkFold(dir); err != nil {
- return err
- }
- }
- if foldPath[fold] == "" {
- foldPath[fold] = name
- return nil
- }
- other := foldPath[fold]
- return fmt.Errorf("unzip %v: case-insensitive file name collision: %q and %q", zipfile, other, name)
- }
-
- // Check total size, valid file names.
- var size int64
- for _, zf := range z.File {
- if !str.HasPathPrefix(zf.Name, prefix) {
- return fmt.Errorf("unzip %v: unexpected file name %s", zipfile, zf.Name)
- }
- if zf.Name == prefix || strings.HasSuffix(zf.Name, "/") {
- continue
- }
- name := zf.Name[len(prefix)+1:]
- if err := module.CheckFilePath(name); err != nil {
- return fmt.Errorf("unzip %v: %v", zipfile, err)
- }
- if err := checkFold(name); err != nil {
- return err
- }
- if path.Clean(zf.Name) != zf.Name || strings.HasPrefix(zf.Name[len(prefix)+1:], "/") {
- return fmt.Errorf("unzip %v: invalid file name %s", zipfile, zf.Name)
- }
- s := int64(zf.UncompressedSize64)
- if s < 0 || maxSize-size < s {
- return fmt.Errorf("unzip %v: content too large", zipfile)
- }
- size += s
- }
-
- // Unzip, enforcing sizes checked earlier.
- for _, zf := range z.File {
- if zf.Name == prefix || strings.HasSuffix(zf.Name, "/") {
- continue
- }
- name := zf.Name[len(prefix):]
- dst := filepath.Join(dir, name)
- if err := os.MkdirAll(filepath.Dir(dst), 0777); err != nil {
- return err
- }
- w, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0444)
- if err != nil {
- return fmt.Errorf("unzip %v: %v", zipfile, err)
- }
- r, err := zf.Open()
- if err != nil {
- w.Close()
- return fmt.Errorf("unzip %v: %v", zipfile, err)
- }
- lr := &io.LimitedReader{R: r, N: int64(zf.UncompressedSize64) + 1}
- _, err = io.Copy(w, lr)
- r.Close()
- if err != nil {
- w.Close()
- return fmt.Errorf("unzip %v: %v", zipfile, err)
- }
- if err := w.Close(); err != nil {
- return fmt.Errorf("unzip %v: %v", zipfile, err)
- }
- if lr.N <= 0 {
- return fmt.Errorf("unzip %v: content too large", zipfile)
- }
- }
-
- return nil
-}
-
-// makeDirsReadOnly makes a best-effort attempt to remove write permissions for dir
-// and its transitive contents.
-func makeDirsReadOnly(dir string) {
- type pathMode struct {
- path string
- mode os.FileMode
- }
- var dirs []pathMode // in lexical order
- filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
- if err == nil && info.Mode()&0222 != 0 {
- if info.IsDir() {
- dirs = append(dirs, pathMode{path, info.Mode()})
- }
- }
- return nil
- })
-
- // Run over list backward to chmod children before parents.
- for i := len(dirs) - 1; i >= 0; i-- {
- os.Chmod(dirs[i].path, dirs[i].mode&^0222)
- }
-}
-
-// RemoveAll removes a directory written by Download or Unzip, first applying
-// any permission changes needed to do so.
-func RemoveAll(dir string) error {
- // Module cache has 0555 directories; make them writable in order to remove content.
- filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
- if err != nil {
- return nil // ignore errors walking in file system
- }
- if info.IsDir() {
- os.Chmod(path, 0777)
- }
- return nil
- })
- return os.RemoveAll(dir)
-}
diff --git a/libgo/go/cmd/go/internal/modfetch/zip_sum_test/testdata/zip_sums.csv b/libgo/go/cmd/go/internal/modfetch/zip_sum_test/testdata/zip_sums.csv
new file mode 100644
index 00000000000..6eb8d7fd839
--- /dev/null
+++ b/libgo/go/cmd/go/internal/modfetch/zip_sum_test/testdata/zip_sums.csv
@@ -0,0 +1,2124 @@
+9fans.net/go,v0.0.2,h1:RYM6lWITV8oADrwLfdzxmt8ucfW6UtP9v1jg4qAbqts=,2c42aad9ed60e24046fbf5720f438884942897197cb790ce58cccdacedd9532d
+aahframe.work,v0.12.3,h1:hc3chv+f49yLYVT/aSEhgpoqd8bS0rDKEew1un8AkSo=,0c7e3fab03920a79ace8e0a9ddf4517225f595ce39f2124ec3d9353508da5dbd
+aahframework.org/essentials.v0,v0.8.0,h1:R/lcfOuhvZptG4IWX/CzAtpiVJFUjbCxLao6DfmeWBA=,d640fe6b83a31ffe09d12eea37de000be7ec8d7330c0a1d7413d6e31a675628d
+bazil.org/fuse,v0.0.0-20180421153158-65cc252bf669,h1:FNCRpXiquG1aoyqcIWVFmpTSKVcx2bQD38uZZeGtdlw=,fce7ed008451861ba30974e95468d716f5ff4fde14e9605dbc2db5fac935c71d
+bitbucket.org/abex/go-optional,v0.0.0-20150902044611-5304370459de,h1:iGmurCCO42qFsQ46DzROSsZJFf8/7AKFH/VpRGd2PBw=,02e1b23db09fb6945ba4ca57c0af8125b608fceae125fe625f6536b9e466e7e0
+bitbucket.org/abex/pathfinder,v0.0.0-20170507112819-bdce8b2efbc9,h1:M1jjfmrcOcmWy2/aABpm3k9h/M6NccmjgLtE5gVl+y8=,8469c0a656a895863d4714a658ee4a9634e78547142fa7239331e15d0143c679
+bitbucket.org/abex/sliceconv,v0.0.0-20151017061159-594a23261816,h1:7XPf5/Oar0LfWbnUY29doBDzSr6ToseiJRqkZtb0YOo=,e2433a32246bd5e2fb5d52bf6dc36188a75c4b59b98f76eb7607035b8525dd37
+bitbucket.org/abex/yumeko,v0.0.0-20190825151534-d98ca20ac08c,h1:ES4kIm83Q1RYr9uhhpQhqh/tqjt8H+Xz4xuSAv5Crcw=,1d352a11b3ed5850a425fde048cafa65b2c079c4e9647c52a339b28276065ba9
+bitbucket.org/liamstask/goose,v0.0.0-20150115234039-8488cc47d90c,h1:bkb2NMGo3/Du52wvYj9Whth5KZfMV6d3O0Vbr3nz/UE=,3d64cac7774bf87a9d050222b87387c112bcb6ef0ea0e2b3324a95330573a0c5
+bitbucket.org/ww/goautoneg,v0.0.0-20120707110453-75cd24fc2f2c,h1:t+Ra932MCC0eeyD/vigXqMbZTzgZjd4JOfBJWC6VSMI=,8ad2afdee1dc46b2c78e986bc2cce89cd0b8815b278a01879ef08d56585c247f
+bou.ke/monkey,v1.0.1,h1:zEMLInw9xvNakzUUPjfS4Ds6jYPqCFx3m7bRmG5NH2U=,20cb7da509322267189d32a125d7e0f782264508bc8e17306c80424514e797ce
+cloud.google.com/go,v0.47.0,h1:1JUtpcY9E7+eTospEwWS2QXP3DEn7poB3E2j0jN74mM=,7739fd24e36a536488115ef0ec9d739e608ee68448f8a469e84855c008b00ecd
+cloud.google.com/go/bigquery,v1.0.1,h1:hL+ycaJpVE9M7nLoiXb/Pn10ENE2u+oddxbD8uu0ZVU=,738d1f726ce24f618ee7563f6c9419e6307f8814548f45ad8a227cffbb1448c0
+cloud.google.com/go/datastore,v1.0.0,h1:Kt+gOPPp2LEPWp8CSfxhsM8ik9CcyE/gYu+0r+RnZvM=,41e93ec9526ae580da90300d7e421a6d39d79cb6118d62ad1d3c06422d8a71bf
+cloud.google.com/go/pubsub,v1.0.1,h1:W9tAK3E57P75u0XLLR82LZyw8VpAnhmyTOxW9qzmyj8=,8bca46a7c5f0dcd576d23fa9a5f107955316d6f0d8f306ee1d6faa7de99c3d29
+cloud.google.com/go/spanner,v1.0.0,h1:jLKThep5kbWLeBhLgtEfm/OPT08n1z7itVTR82WUBQg=,90579f16545e352c662ae9f62dd02dddf834fe10b33d1dbcfbf0a8aadfcd21f8
+cloud.google.com/go/storage,v1.0.0,h1:VV2nUM3wwLLGh9lSABFgZMjInyUbJeaRSE64WuAIQ+4=,baec4756c573ede58f19eb7ae4acaebd7ac3f0c56413ecbbd216ad46a589a5da
+code.cloudfoundry.org/clock,v0.0.0-20180518195852-02e53af36e6c,h1:5eeuG0BHx1+DHeT3AP+ISKZ2ht1UjGhm581ljqYpVeQ=,61785787db7dadaf695506636dcb98c26bbdd0c847f589aa1fb4bbe9ef0e4455
+code.cloudfoundry.org/gofileutils,v0.0.0-20170111115228-4d0c80011a0f,h1:UrKzEwTgeiff9vxdrfdqxibzpWjxLnuXDI5m6z3GJAk=,ec71ca818158525773e53568f71db38f63423822a426e1a18f7d34318e97eb3e
+code.cloudfoundry.org/lager,v2.0.0+incompatible,h1:WZwDKDB2PLd/oL+USK4b4aEjUymIej9My2nUQ9oWEwQ=,ce1da175885c2587ca091532a937108ed646e3bd6bd902640891f75ae70adb8b
+code.gitea.io/gitea,v1.9.5,h1:Q3PROlfPth1NlLGaeYcr6YVqyfAy7txnFpDKe1BXo7Q=,c7b63394004fb8f355d859f11a007ff17126eac092f90507a80392335351a6df
+code.gitea.io/sdk,v0.0.0-20191030144301-2a5a0e75e5cf,h1:uXUz7lXbs33QAYIu1rF0o8tNsa3DlDDSMYek/3CldIo=,6472a2b30b8108cae9b6a4914ce986d61e9ed37baade5ad35cb337270602b70a
+code.gitea.io/sdk/gitea,v0.0.0-20191030144301-2a5a0e75e5cf,h1:aAwV+RyellgKMACMu21Vyv/XgSHipLvbJsXDoXP1Yv0=,62570a621e1bf13724fb1f45d7ea95c48de02abb00468cf1da4b35820203d3b4
+contrib.go.opencensus.io/exporter/aws,v0.0.0-20181029163544-2befc13012d0,h1:YsbWYxDZkC7x2OxlsDEYvvEXZ3cBI3qBgUK5BqkZvRw=,3e351a39c3caf9ce263155f2d6e5a4e0cd84177661e1bf40f0d8fd06854831e9
+contrib.go.opencensus.io/exporter/ocagent,v0.6.0,h1:Z1n6UAyr0QwM284yUuh5Zd8JlvxUGAhFZcgMJkMPrGM=,e526ae16b06c682c3661738938f912a2e301a5e2d0ba875c7a0ec40fde825491
+contrib.go.opencensus.io/exporter/stackdriver,v0.12.8,h1:iXI5hr7pUwMx0IwMphpKz5Q3If/G5JiWFVZ5MPPxP9E=,db745d331f8a0455abbbcfeb4bb33dbc5cbb73a119b4e86f833cd497cfc72559
+contrib.go.opencensus.io/integrations/ocsql,v0.1.4,h1:kfg5Yyy1nYUrqzyfW5XX+dzMASky8IJXhtHe0KTYNS4=,0a4be97a579c5212bd83d21a177b279bc5b0c04350a63c56e8f8e611ffcba09c
+contrib.go.opencensus.io/resource,v0.1.1,h1:4r2CANuYhKGmYWP02+5E94rLRcS/YeD+KlxSrOsMxk0=,07ad3d36f96cb86ecba376353d02730855e117db3ffac5c2ab2c7cdf4eca25dc
+cuelang.org/go,v0.0.11,h1:t7s006dOWh6tgnwPifvO3l704eg8oPuIH7AR1hfTFYk=,69bdc6b3f1000308d399f166dd0d46576019f68cbf37765bd30821584b1296de
+dmitri.shuralyov.com/app/changes,v0.0.0-20180602232624-0a106ad413e3,h1:hJiie5Bf3QucGRa4ymsAUOxyhYwGEz1xrsVk0P8erlw=,a4d9079d5550094191f608c628ff2eb6999e0d0b6aea894ba59d063107777dfa
+dmitri.shuralyov.com/gpu/mtl,v0.0.0-20190408044501-666a987793e9,h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY=,ca5330901fcda83d09553ac362576d196c531157bc9c502e76b237cca262b400
+dmitri.shuralyov.com/html/belt,v0.0.0-20180602232347-f7d459c86be0,h1:SPOUaucgtVls75mg+X7CXigS71EnsfVUK/2CgVrwqgw=,bd6b059cceaea8ab23e65b8118fab5d22f82149417fcc5fcf930ef9a52d582f1
+dmitri.shuralyov.com/service/change,v0.0.0-20181023043359-a85b471d5412,h1:GvWw74lx5noHocd+f6HBMXK6DuggBB1dhVkuGZbv7qM=,8a1ba9c7ba7eea08389c15315a23485d19fc7166d30b5b47a35fab949c4bf886
+dmitri.shuralyov.com/state,v0.0.0-20190403024436-2cf192113e66,h1:/74W9PTF+vJhgRsWpPWlZT77+phX7vXPcelX7JXFu5s=,eda200c06f669f06c56e1d53a1879b88dd7ee99eea1f56d329028fa773cfc2dd
+docker.io/go-docker,v1.0.0,h1:VdXS/aNYQxyA9wdLD5z8Q8Ro688/hG8HzKxYVEVbE6s=,b162036b1af6e1e5434e2e5a35faa7191014529259fbf2f4f1b3e7de6b816516
+fyne.io/fyne,v1.1.2,h1:a9YLFXxqN7lKNqTrk+ocw3/3ROrn6aFiofix8ATVOBc=,dc2d7fd4a4ee9852328fc79c52459a53d94d26f6ac3282ebcacc0c6cd6688d23
+git.apache.org/thrift.git,v0.13.0,h1:/3bz5WZ+sqYArk7MBBBbDufMxKKOA56/6JO6psDpUDY=,10412b7bc503ef2a7cc3bf58fe69e5a2d2594354ae3cc5ab2baa2b3ecc8c4f1d
+git.fd.io/govpp.git,v0.1.0,h1:fV5H9ghURFfmNAjk7Scb/aG3OGwevLayHfSdS8GsYjE=,0a023d4b5b36131a4fde2c3d19047bbd4f5c3a7cc07c1ccf40bfb75a501f51b3
+git.torproject.org/pluggable-transports/goptlib.git,v1.1.0,h1:LMQAA8pAho+QtYrrVNimJQiINNEwcwuuD99vezD/PAo=,f6769c4813dedf933071289bfd9381aa5eb3a012b3a32d1da02aa9bebd3a3b5b
+gitee.com/nggs/util,v0.0.0-20190830024003-3e49d2efc84b,h1:6KQpPEs326uPrICQy9x/PxmR8U0v/XsFzpt0k1nFKcY=,a062c99c2b560a36168fe51eab8f17f4fadf5d534238881628e83d8d61e51c2a
+github.com/1and1/oneandone-cloudserver-sdk-go,v1.0.1,h1:RMTyvS5bjvSWiUcfqfr/E2pxHEMrALvU+E12n6biymg=,7f068808fc0857d7de8c8f829cc380dce1c6611a3fc819daf4421e9bcb75a07c
+github.com/99designs/gqlgen,v0.10.1,h1:1BgB6XKGTHq7uH4G1/PYyKe2Kz7/vw3AlvMZlD3TEEY=,04b9e7d8a3df6543cd870325b1140ce9ac3f4bbfd8c90ebecec4f908dd420d08
+github.com/AlexStocks/log4go,v1.0.5,h1:45boeHy0qh0NFBaEhrFT/pUKzQUGf7q2Ux1iQDr/f6o=,59371c2108f62aa9a2233ca8f7de57868ad2c64313b2d68434e0ed6a1748ce2c
+github.com/AndreasBriese/bbloom,v0.0.0-20190306092124-e2d15f34fcf9,h1:HD8gA2tkByhMAwYaFAX9w2l7vxvBQ5NMoxDrkhqhtn4=,6d7c1af06f8597fde1e86166f26416057392f1b0bdb84f2af555aa461282dd18
+github.com/AsynkronIT/goconsole,v0.0.0-20160504192649-bfa12eebf716,h1:Pk/Kzi5O0T4QxfqvbaUsh8UklbJ9BklZ/ClZBptX5WU=,5a2507b89bb4436881718d785a0ef383652aa99782508b7444cf20255082dab9
+github.com/Azure/azure-amqp-common-go,v1.1.4,h1:DmPXxmLZwi/71CgRTZIKR6yiKEW3eC42S4gSBhfG7y0=,4b800793ff4fefa86a427c445e3a4671b8d1dcd87a44075f6309cace6b0e01e2
+github.com/Azure/azure-amqp-common-go/v2,v2.1.0,h1:+QbFgmWCnPzdaRMfsI0Yb6GrRdBj5jVL8N3EXuEUcBQ=,9a91c6ac9656faea0ddfb0bb497c109451faaba09b85ce3237309f5982b095a3
+github.com/Azure/azure-pipeline-go,v0.2.2,h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY=,3e4f90f6ec86d4875e8758f01947adece11c1b4317b448fe0197188765c83efc
+github.com/Azure/azure-sdk-for-go,v36.0.0+incompatible,h1:XIaBmA4pgKqQ7jInQPaNJQ4pOHrdJjw9gYXhbyiChaU=,71db17c798b784b96a45efdbabd18ad86d03e5f490701081a2f7bf19efa67c13
+github.com/Azure/azure-service-bus-go,v0.9.1,h1:G1qBLQvHCFDv9pcpgwgFkspzvnGknJRR0PYJ9ytY/JA=,81e42ed51354d71b53daf93b5b9f0f2c20fb7d2923f45ab88eea22419bfbc63a
+github.com/Azure/azure-storage-blob-go,v0.8.0,h1:53qhf0Oxa0nOjgbDeeYPUeyiNmafAFEY95rZLK0Tj6o=,3b02b720c25bbb6cdaf77f45a29a21e374e087081dedfeac2700aed6147b4b35
+github.com/Azure/go-ansiterm,v0.0.0-20170929234023-d6e3b3328b78,h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=,b7a14d18891abef8b8a2e622f62a3cebeac32f9f1223dc9d62a6f8769861aaf2
+github.com/Azure/go-autorest,v13.3.0+incompatible,h1:8Ix0VdeOllBx9jEcZ2Wb1uqWUpE1awmJiaHztwaJCPk=,44fdf420bd96bb97df7910806efb25f2fae701078c39f5592f5c4131ffce41e6
+github.com/Azure/go-autorest/autorest,v0.9.2,h1:6AWuh3uWrsZJcNoCHrCF/+g4aKPCU39kaMO6/qrnK/4=,26df5fc6c03e8c66021dd272b04242f6c2ce2a5975f87799dfcf1b9597800dba
+github.com/Azure/go-autorest/autorest/adal,v0.8.0,h1:CxTzQrySOxDnKpLjFJeZAS5Qrv/qFPkgLjx5bOAi//I=,af59c00ec7e19cda9b960babaee7bfe27cf3d5f7415ac3afdb4cddc73d4b5743
+github.com/Azure/go-autorest/autorest/azure/auth,v0.4.0,h1:18ld/uw9Rr7VkNie7a7RMAcFIWrJdlUL59TWGfcu530=,2fe394de946f42c2ea8ad07f1b282eac6bb56e372f5c2a35e49dfef0cf015ccb
+github.com/Azure/go-autorest/autorest/azure/cli,v0.3.0,h1:5PAqnv+CSTwW9mlZWZAizmzrazFWEgZykEZXpr2hDtY=,729d09b69a1912faa7c2395389bbf67ec22a420d42c15414823d43a380a2f09a
+github.com/Azure/go-autorest/autorest/date,v0.2.0,h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM=,9ec7b48c865a185b72d3822ac2dff7e0163315a23911c87a479a3db616af9853
+github.com/Azure/go-autorest/autorest/mocks,v0.3.0,h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc=,d5daf74cf531c37b27b39d3bf65b6930aee4b226b5fb4ea91a87be93aaf37f10
+github.com/Azure/go-autorest/autorest/to,v0.3.0,h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8=,955ee6bde8af1314d22b51f265799147f42f7c705714b1cc1c51144441d5fa9c
+github.com/Azure/go-autorest/autorest/validation,v0.2.0,h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4=,10f40b0d943d4d1a0a1cbcb9fdb058b8a3a59a55ae26583566dfaa82883f86ea
+github.com/Azure/go-autorest/logger,v0.1.0,h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY=,5e0804944db0707502c9d29defb54961c281a19311c9eb321a246ba054ac5256
+github.com/Azure/go-autorest/tracing,v0.5.0,h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k=,4951b0f4a88a44b7ed4e4834654e4e01922ade35d97899b8596998184abbc652
+github.com/Azure/go-ntlmssp,v0.0.0-20180810175552-4a21cbd618b4,h1:pSm8mp0T2OH2CPmPDPtwHPr3VAQaOwVF/JbllOPP4xA=,64cd585589154ce18d7557ccfd8d26e2c2f5c4ecf13b17bdbfb913e17863d280
+github.com/BurntSushi/locker,v0.0.0-20171006230638-a6e239ea1c69,h1:+tu3HOoMXB7RXEINRVIpxJCT+KdYiI7LAEAUrOw3dIU=,836038343df9e9126b59d54201951191898bd875ec32d93c2018d759f358fcfb
+github.com/BurntSushi/toml,v0.3.1,h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=,815c6e594745f2d8842ff9a4b0569c6695e6cdfd5e07e5b3d98d06b72ca41e3c
+github.com/BurntSushi/xgb,v0.0.0-20160522181843-27f122750802,h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=,f52962c7fbeca81ea8a777d1f8b1f1d25803dc437fbb490f253344232884328e
+github.com/BurntSushi/xgbutil,v0.0.0-20190907113008-ad855c713046,h1:O/r2Sj+8QcMF7V5IcmiE2sMFV2q3J47BEirxbXJAdzA=,492ce6b11d7faaec4e15d1279d81e28d2e0e9844ad117f9de9411286a5b0e305
+github.com/ChrisTrenkamp/goxpath,v0.0.0-20170922090931-c385f95c6022,h1:y8Gs8CzNfDF5AZvjr+5UyGQvQEBL7pwo+v+wX6q9JI8=,8d79cd78a309a1b0f22790d354b9c4c929c64d03c7e572627ba430908fbb9d78
+github.com/CodisLabs/codis,v0.0.0-20181104082235-de1ad026e329,h1:KyRmPlfd2xewxb54vIBPNILFyCh2R3zNDwLZURDxT0E=,f61ae85688d10dddf0d62c30aaaa2701373fc11851dae4435de0212513c578c1
+github.com/DATA-DOG/go-sqlmock,v1.3.3,h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08=,5dc430c2836af3bfc85f590366a6e284a251978e9397d0d54fa97db913263461
+github.com/DataDog/datadog-go,v3.2.0+incompatible,h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4=,ede4a024d3c106b2f57ca04d7bfc7610e0c83f4d8a3bace2cf87b42fd5cf66cd
+github.com/DataDog/zstd,v1.4.0,h1:vhoV+DUHnRZdKW1i5UMjAk2G4JY8wN4ayRfYDNdEhwo=,601f6fe1f4138d676946f4b27f7a714bbedea8c1785d10c1b74a03c68ad13070
+github.com/FiloSottile/b2,v0.0.0-20170207175032-b197f7a2c317,h1:1GuMjC4tjfwnWBdoTS7YqtQ3JIsEft6NRcdmXdzvYYc=,6ff3cfed3f510fc69b47f263936642950afc7892f557ed716dd8c5584f187411
+github.com/GeertJohan/go-sourcepath,v0.0.0-20150925135350-83e8b8723a9b,h1:D4H5C4VvURnduTQydyEhA6OWnNcZTLUlNX4YBw5yelY=,8bdcf0b6cc58f5ec1cef031b4052e6d699683bf1daf4a1a20f92f67d5be06b82
+github.com/GeertJohan/go.incremental,v1.0.0,h1:7AH+pY1XUgQE4Y1HcXYaMqAI0m9yrFqo/jt0CW30vsg=,ce46b3b717f8d2927046bcfb99c6f490b1b547a681e6b23240ac2c2292a891e8
+github.com/GeertJohan/go.rice,v1.0.0,h1:KkI6O9uMaQU3VEKaj01ulavtF7o1fWT7+pk/4voiMLQ=,2fc48b9422bf356c18ed3fe32ec52f6a8b87ac168f83d2eed249afaebcc3eeb8
+github.com/GoogleCloudPlatform/cloudsql-proxy,v0.0.0-20191017031552-46c5533ff5ba,h1:ZNYxMf89tMi+NydPAq7yGAxMfMNaMHgG+7WL1CEabjc=,25a1fe9f189e6a4d6e108f22abaec7dd36edc819ab5af1a3e448450b73026271
+github.com/GoogleCloudPlatform/docker-credential-gcr,v1.5.0,h1:wykTgKwhVr2t2qs+xI020s6W5dt614QqCHV+7W9dg64=,4acfcaddfe2aa53e1e643ea13ff3534a2fca1e043d008ab5bba5a0910db1f7c2
+github.com/IBM/go-sdk-core,v1.0.1,h1:vF9Lsoih6fxrAxzJp2fWqnO6Mg8x8O8fzwQAdFoUdok=,e063c8f79f94936a165355f61bdc6f2c404975472ad6be5e47bfdb87fb393c72
+github.com/Jeffail/gabs,v1.4.0,h1://5fYRRTq1edjfIrQGvdkcd22pkYUrHZ5YC/H2GJVAo=,cb193b1477109c19b0d2521fc61735619202e58ac4699605f72313d70884ca9e
+github.com/Joker/hpp,v0.0.0-20180418125244-6893e659854a,h1:PiDAizhfJbwZMISZ1Itx1ZTFeOFCml89Ofmz3V8rhoU=,4e99372a7576c587c107fb16d1ae0e8662111e2ca5e5127f7cd93bb01cd02076
+github.com/Joker/jade,v1.0.0,h1:lOCEPvTAtWfLpSZYMOv/g44MGQFAolbKh2khHHGu0Kc=,c4a7f39e7483446ff7b0d7e213a4cd813c783108d6d2e7c6e9a8e968789b18bc
+github.com/Knetic/govaluate,v3.0.1-0.20171022003610-9aa49832a739+incompatible,h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw=,d1d4ac5b4f5759726368f68b0d47f3c17c6d8689243ec66272311359d28a865b
+github.com/Kodeworks/golang-image-ico,v0.0.0-20141118225523-73f0f4cfade9,h1:1ltqoej5GtaWF8jaiA49HwsZD459jqm9YFz9ZtMFpQA=,1d677069e35c4a3e4f290e68c6e2391f6237aee9ce3f39448ed09a2ddab274b0
+github.com/Kubuxu/go-os-helper,v0.0.1,h1:EJiD2VUQyh5A9hWJLmc6iWg6yIcJ7jpBcwC8GMGXfDk=,90a16f95a8a238910ab0dc9004cb6e56242a10810bf1e296a263d2e385f002e0
+github.com/KyleBanks/depth,v1.2.1,h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=,8f3e9af2e038f561d9c34b631fddc7db39e39992a121fd087f0bf980026464d9
+github.com/MakeNowJust/heredoc,v1.0.0,h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=,062afe6e11aa3c3ac0035d08907b80d5e5b7563905603391ee774bda440abf16
+github.com/Masterminds/goutils,v1.1.0,h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg=,b9520e8d2775ac1ff3fbf18c93dbc4b921133f957ae274f5b047965e9359d27d
+github.com/Masterminds/semver,v1.5.0,h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=,15f6b54a695c15ffb205d5719e5ed50fab9ba9a739e1b4bdf3a0a319f51a7202
+github.com/Masterminds/semver/v3,v3.0.1,h1:2kKm5lb7dKVrt5TYUiAavE6oFc1cFT0057UVGT+JqLk=,f1eef1a1b6489d895eb32326f3369bd1615812a4c5fbfe60b2b6cc774c6340f0
+github.com/Masterminds/sprig,v2.22.0+incompatible,h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60=,1b4d772334cc94e5703291b5f0fe4ac4965ac265424b1060baf18ef5ff9d845c
+github.com/Masterminds/squirrel,v1.1.0,h1:baP1qLdoQCeTw3ifCdOq2dkYc6vGcmRdaociKLbEJXs=,cede1b0a054e000a5e6a8000cb02de7ab64ddca9e0f4153732274627adeed0ae
+github.com/Microsoft/go-winio,v0.4.14,h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU=,7a86644691d3c86c77ae0b639fa27029706552f00cd51b445389a61694576f6b
+github.com/Microsoft/hcsshim,v0.8.6,h1:ZfF0+zZeYdzMIVMZHKtDKJvLHj76XCuVae/jNkjj0IA=,900feaaec1c41d4e111a66bbde330b41fc78902c70c0af37d611505bf42e0632
+github.com/NYTimes/gziphandler,v1.1.1,h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=,2948d9f70e4388f13f4ed9400df41dca60841059f7dcc30cf909c82796cc705a
+github.com/NaverCloudPlatform/ncloud-sdk-go,v0.0.0-20180110055012-c2e73f942591,h1:/P9HCl71+Eh6vDbKNyRu+rpIIR70UCZWNOGexVV3e6k=,2e9eacfe3e6785beef75391bcebc14a6a082687c0f0582bc441c3d0106b8bf5c
+github.com/NebulousLabs/entropy-mnemonics,v0.0.0-20181203154559-bc7e13c5ccd8,h1:wPFCU8DwC4k5C2LfJc/rVp4cmTqzF3vyydxRR3b3HhQ=,6a65ca779cd216db7bf326ebbb5a26a87d85ff6a6ba832eec281c5c09a8294e3
+github.com/Netflix/go-expect,v0.0.0-20180615182759-c93bf25de8e8,h1:xzYJEypr/85nBpB11F9br+3HUrpgb+fcm5iADzXXYEw=,fbe7b2f58ecb0e1067a6670bbcf0718d54ec407aab81790cc9e58db9a6774775
+github.com/NickBall/go-aes-key-wrap,v0.0.0-20170929221519-1c3aa3e4dfc5,h1:5BIUS5hwyLM298mOf8e8TEgD3cCYqc86uaJdQCYZo/o=,fd78212ec77052b032b9fc308c028e8fc166de3d6ae4494f5eb3254930728a0b
+github.com/Nvveen/Gotty,v0.0.0-20120604004816-cd527374f1e5,h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=,362ac7b59d74231419471b65b60079d167785b97fd4aa0de71575088cd192b1e
+github.com/OneOfOne/xxhash,v1.2.5,h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=,7ab3c6a0e7c16c987a589e50a9a353e8877cfffea02bf9e04e370fd26a0c85e1
+github.com/OpenBazaar/jsonpb,v0.0.0-20171123000858-37d32ddf4eef,h1:+aqKrHtCJTRp8ziyrjfHbTF5puPQZfgRt65+iM7FD2w=,5f6ea1466b9d27f016c1bf2650669c788db623142cdc8a1794bc1784fc80fc4e
+github.com/OpenBazaar/wallet-interface,v0.0.0-20190807004547-aa8e214acd9b,h1:KjQH45msWRtDhb5JAbBW+eU4M/9xIm11rsOSgAaqDOs=,f7ac40d665241766533b1a49a726068d9dfea5e02c7fd426df81f9e390a7003e
+github.com/OpenDNS/vegadns2client,v0.0.0-20180418235048-a3fa4a771d87,h1:xPMsUicZ3iosVPSIP7bW5EcGUzjiiMl1OYTe14y/R24=,b73d6b37d519c7bf181e502b92962f1bf961bb0ca3a9ef7057c3d9a8a3c2f3cd
+github.com/OwnLocal/goes,v1.0.0,h1:81QQ3z6dvLhgXlkNpLkaYhk8jiKS7saFG01xy039KaU=,ebb6c7e2c12577c590d2d5546b7a4b4e6fa75c9a408ae5244b5ba2cf09dec1d6
+github.com/PuerkitoBio/goquery,v1.5.0,h1:uGvmFXOA73IKluu/F84Xd1tt/z07GYm8X49XKHP7EJk=,f0064ad35f21c2b9d1377b94f09ead56ec1862da3807e78c26b99c4b3a04f5e6
+github.com/PuerkitoBio/purell,v1.1.1,h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=,59e636760d7f2ab41c2f80c1784b1c73d381d44888d1999228dedd634ddcf5ed
+github.com/PuerkitoBio/urlesc,v0.0.0-20170810143723-de5bf2ad4578,h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=,1793124273dd94e7089e95716d40529bcf70b9e87162d60218f68dde4d6aeb9d
+github.com/Quasilyte/inltest,v0.7.0,h1:yHvFAaoXn+6iK2uKtb8mXB9KURz6SDPyszoyBAC0Xk4=,8fb4273cea3514742aec06ed58f20cea1214cc542799c70c331a80865aaf3988
+github.com/RangelReale/osin,v1.0.1,h1:JcqBe8ljQq9WQJPtioXGxBWyIcfuVMw0BX6yJ9E4HKw=,edbcc6208879bffa533369bbf417db41c1322193ca05d0deecf13075972c9d57
+github.com/RangelReale/osincli,v0.0.0-20160924135400-fababb0555f2,h1:x8Brv0YNEe6jY3V/hQglIG2nd8g5E2Zj5ubGKkPQctQ=,82fc65bad3da9fc26cc77b485e10ee117459e830547ce89592c41d92871e1129
+github.com/Rican7/retry,v0.1.0,h1:FqK94z34ly8Baa6K+G8Mmza9rYWTKOJk+yckIBB5qVk=,c0e956967f2f632ffc889eeae5b82e437f30e9be409870cdd1e7998def458843
+github.com/RoaringBitmap/roaring,v0.4.7,h1:eGUudvFzvF7Kxh7JjYvXfI1f7l22/2duFby7r5+d4oc=,515892d9b8e4350e5ac5b7a487da94d5d9ab9641071e002b778dd864b7a31c2a
+github.com/SAP/go-hdb,v0.14.1,h1:hkw4ozGZ/i4eak7ZuGkY5e0hxiXFdNUBNhr4AvZVNFE=,273de28a254c39e9f24293b864c1d664488e4a5d44d535755a5e5b68ae7eed8d
+github.com/Sereal/Sereal,v0.0.0-20190529075751-4d99287c2c28,h1:kmfzzWpCZIrVhxx4V/2oSGhGnhtX+/JijVIlPuKYfHg=,eebfe79e62b5a07f98a367d8a84bcf33ed69818c031e70c3ebc6e9fc34361466
+github.com/SermoDigital/jose,v0.0.0-20180104203859-803625baeddc,h1:LkkwnbY+S8WmwkWq1SVyRWMH9nYWO1P5XN3OD1tts/w=,1711f20ec5b1498c98e46b96e578f39b723557ab50183d644702d40f44a1a345
+github.com/Shopify/go-lua,v0.0.0-20181106184032-48449c60c0a9,h1:+2M9NEk3+xSg0+bWzt1kxsL6EtoEg7sgtT11CZjGwq8=,3e399584ff4a876314243c01be3cba5b98b46bba483d6996dd2d0e7f161b7ad8
+github.com/Shopify/goreferrer,v0.0.0-20181106222321-ec9c9a553398,h1:WDC6ySpJzbxGWFh4aMxFFC28wwGp5pEuoTtvA4q/qQ4=,e47cdf750e6aa39707b90e62f4f87e97abb8d64b2525a16c021c82efb24f9969
+github.com/Shopify/sarama,v1.24.1,h1:svn9vfN3R1Hz21WR2Gj0VW9ehaDGkiOS+VqlIcZOkMI=,c5e06f9c835846eeb5cbbbc540ab949f9775ff37c08cab503dd820b858b1f2e7
+github.com/Shopify/toxiproxy,v2.1.4+incompatible,h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc=,9427e70698ee6a906904dfa0652624f640619acef40652a1e5490e13b31e7f61
+github.com/Sirupsen/logrus,v1.0.6,h1:HCAGQRk48dRVPA5Y+Yh0qdCSTzPOyU1tBJ7Q9YzotII=,dc69c77019152ace477a7f5c0cd97fd25d6ab866e01e1dd06f391722f4f9fba9
+github.com/StackExchange/wmi,v0.0.0-20190523213315-cbe66965904d,h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=,68f499ad4c3f45fc6c286fd2a5966e8e15c0f3abc1f96fbf4a979245df936e16
+github.com/Stebalien/go-bitfield,v0.0.1,h1:X3kbSSPUaJK60wV2hjOPZwmpljr6VGCqdq4cBLhbQBo=,9b17a2749922c810f3598606b87b5f2ba0f3c6abc70966911a8c32f0533ee827
+github.com/Telmate/proxmox-api-go,v0.0.0-20190815172943-ef9222844e60,h1:iEmbIRk4brAP3wevhCr5MGAqxHUbbIDHvE+6D1/7pRA=,55dd16e2cd8e6c1464c6456007cdc5d8676b8b096e90230312daa8c84b57b34d
+github.com/TheThingsNetwork/api,v0.0.0-20190522113053-d844e8c040fc,h1:hDk+SAT2tV584ye1hqMN5+NHL6RHJDIbe97cNot6/WQ=,7931f7c4699cd1019c950a68361e3b3fec8bbb8e9204c65c08b50bd588ac506a
+github.com/TheThingsNetwork/go-account-lib,v2.0.3+incompatible,h1:pnDIalIqac/VlXenPr+L1XEEf3gIq1eIoZ78S5AP1/s=,e62dcb784cbd28bcec55cf332f7dc06779c75c7df66299f4ce542cd6852358b4
+github.com/TheThingsNetwork/go-cayenne-lib,v1.0.0,h1:be7h6E/69+qaYs1iwQ2xjGjSFPXzvU3q6AWBCWayG2Y=,17091b77ac39b8e73ca6ac3f39f34909bc6a3770098ff2dd534b59a10f6e66ad
+github.com/TheThingsNetwork/go-utils,v0.0.0-20190813113035-8715cf82e887,h1:DF/1gkOPk3jtwWa9dFd5tUtwb6z3bLw9tZ/UALbS5Ck=,be4c7c2955630b63300f21773efcdc991d5ff201a53b01d92b2f20fede77065c
+github.com/TheThingsNetwork/ttn,v2.10.1+incompatible,h1:LQw+g+kinajii5DHJ6I2o82ObaU/Ws+YYgdLkF5eF54=,4a803fe23636f9c99926e6b5a2b956fb42e84ca38c98458a12bd7fe1c22f7439
+github.com/TheThingsNetwork/ttn/api,v0.0.0-20190516081709-034d40b328bd,h1:vCjDYImJDdW+39EXwij00yzDi1pd3TmP6XtCteDJBd0=,9cda2f899f15f57e8f649bbffb955a8153d6c25a13a4e969df8898bb61559a44
+github.com/TheThingsNetwork/ttn/core/types,v0.0.0-20191015060859-00a6f7874bb9,h1:tlWwCxI3/Zu4vJ4dLWb2wMOYSkeMBvLAxQGwJDCFXi8=,7b3895805d6ac341e5df44c2c8154b374b4bed4c8f54e248ea967abfc37186e7
+github.com/TheThingsNetwork/ttn/utils/errors,v0.0.0-20190516081709-034d40b328bd,h1:ITXOJpmUR4Jhp3Xb/xNUIJH4WR0h2/NsxZkSDzFIFiU=,d64decf456c10fdbbb887212ea63749b495264c40bb5ac047b9f0e5ccd7e540b
+github.com/TheThingsNetwork/ttn/utils/random,v0.0.0-20190516081709-034d40b328bd,h1:zKTRK1r3K55XxHuUGxnqYg9aiPDduYeilHUEHua+F+Y=,c504030254919a902b3957267b7ce1870f909cbdd65f0f927819f60710e41d9b
+github.com/TheThingsNetwork/ttn/utils/security,v0.0.0-20190516081709-034d40b328bd,h1:og10Wq5S/QC+f4ziON4vrxlYKv9gfEKxG8v/MDs00xw=,e6f013adee3a7a212a6f892db59c8efaf715fe49413e6dbca22229fa04f0d006
+github.com/Unknwon/cae,v0.0.0-20160715032808-c6aac99ea2ca,h1:xU8R31tsvj6TesCBog973+UgI3TXjh/LqN5clki6hcc=,15a1394a603423c5bcd4659275be09d7696774990d5f127500f4156c1a78eb85
+github.com/Unknwon/com,v0.0.0-20190321035513-0fed4efef755,h1:1B7wb36fHLSwZfHg6ngZhhtIEHQjiC5H4p7qQGBEffg=,2cfba36da8f59c6dd8c7a20af59e5ccf9558f42bde7e0918a64a9b68dafcf271
+github.com/Unknwon/i18n,v0.0.0-20171114194641-b64d33658966,h1:Mp8GNJ/tdTZIEdLdZfykEJaL3mTyEYrSzYNcdoQKpJk=,a5ce1436582e797d60e967d853fd22458fc7edeb31bd390d6ace979133bedb78
+github.com/Unknwon/paginater,v0.0.0-20170405233947-45e5d631308e,h1:HnbTtNLKnRmwn85vBmyl7nNJCXUw4rh6X3UeIX5nvko=,60e3af4ba9b482892127f829ec7cc837977ca9e9e634be855d599cc08230e606
+github.com/VividCortex/ewma,v1.1.1,h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM=,eebee7c0f20e96abbda1611ed2a3d26b4c2c10393caa6a2dfd1605763a5c1a12
+github.com/VividCortex/gohistogram,v1.0.0,h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE=,16ebeceeb7e4066f90edbfb90282cd90d4dad0f71339199551de3fbdc7e8c545
+github.com/Workiva/go-datastructures,v1.0.50,h1:slDmfW6KCHcC7U+LP3DDBbm4fqTwZGn1beOFPfGaLvo=,1ac8c9334b63ee2b089b7ecc3b6c8d45793cc4ef4c460f6ebbfd6ecea3ee83bc
+github.com/a8m/mark,v0.1.1-0.20170507133748-44f2db618845,h1:hIjQrEARcc9LcH8igte3JBpWBZ7+SpinU70dOjU/afo=,048bfeb7427ff5622874d874a52d7215a2cea99f9741c031e9963348785103c2
+github.com/abbot/go-http-auth,v0.4.0,h1:QjmvZ5gSC7jm3Zg54DqWE/T5m1t2AfDu6QlXJT0EVT0=,8204bca24734f55f179dd1c0b820ae5be83151268693a147086f33cd2d4d473c
+github.com/abdullin/seq,v0.0.0-20160510034733-d5467c17e7af,h1:DBNMBMuMiWYu0b+8KMJuWmfCkcxl09JwdlqwDZZ6U14=,bcbe9a2c1e3ac0b981ee436cd1bbb2da8220527511b3cea6517a28a881636814
+github.com/abronan/valkeyrie,v0.0.0-20191010124425-1ae9442de16e,h1:4SrbWyef51DHDc957/8Ms/fDM4D+3bkbXqg6OTnIEAo=,553dce6f5ff57f7ccc5ed6a94e6bf29b38b8773236f3b85bb4025dc0d10d2a92
+github.com/aead/siphash,v1.0.1,h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg=,25da04ff418e0b2871b1193a3478977b4aa66c20737b9ca70a5040b876b6d3d9
+github.com/aerogo/http,v1.0.12,h1:1o5QW6TQLNuutQLuPCX0Tn7g/sSH3JMHv79UGIBpvkw=,a58d344ff2010737d2418050f4188339087cfb369c903bd31e20ccba388304a1
+github.com/afex/hystrix-go,v0.0.0-20180502004556-fa1af6a1f4f5,h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw=,c0e0ea63b57e95784eeeb18ab8988ac2c3d3a17dc729d557c963f391f372301c
+github.com/agext/levenshtein,v1.2.2,h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE=,07caaae8fcdb7c83195a0afffc03c9df76275b1e9a7b69dabfe0d2f47729bc7c
+github.com/agl/ed25519,v0.0.0-20170116200512-5312a6153412,h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI=,98c1510ac20b7d61bf4e2c76e7184fcbd0a8b78b0fc667c2b772777912963d3f
+github.com/agnivade/levenshtein,v1.0.1,h1:3oJU7J3FGFmyhn8KHjmVaZCN5hxTr7GxgRue+sxIXdQ=,cb0e7f070ba2b6a10e1c600d71f06508404801ff45046853001b83be6ebedac3
+github.com/ajg/form,v1.5.1,h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=,b063b07639670ce9b6a0065b4dc35ef9e4cebc0c601be27f5494a3e6a87eb78b
+github.com/ajstarks/svgo,v0.0.0-20190826172357-de52242f3d65,h1:kZegOsPGxfV9mM8WzfllNZOx3MvM5zItmhQlvITKVvA=,1459a44f9162f463b59eacf58e4bb8873e612c5b3df45fc6e34074310d2269ae
+github.com/akamai/AkamaiOPEN-edgegrid-golang,v0.9.0,h1:rXPPPxDA4GCPN0YWwyVHMzcxVpVg8gai2uGhJ3VqOSs=,91c3a4743d959b3bb2bb7359790df4688021830e482d393ea6d4f3a27aebd63d
+github.com/akavel/rsrc,v0.8.0,h1:zjWn7ukO9Kc5Q62DOJCcxGpXC18RawVtYAGdz2aLlfw=,13954a09edc3a680d633c5ea7b4be902df3a70ca1720b349faadca44dc0c7ecc
+github.com/akyoto/assert,v0.2.3,h1:ftENRGDEK5AKuKmZb9LtbDIHeE8p8cIYI4M92CbA9nE=,f0a31d5859109c37568b8702fcf92cd3a49ec4892dace74d113df5fd49491975
+github.com/akyoto/color,v1.8.11,h1:uCQi+uRyngo1cJhJSv28PQmduGFiOAGNF6F9MFoRDek=,0fa16c51743ca03e108fde20eabb070d17d25111cb287e15f8567268d439098a
+github.com/akyoto/colorable,v0.1.7,h1:ge91E25hiOiT/Zu47ij/rTO3cks7wMlTrcQspua1hFM=,07c2dd4d994d9ff1dad97ad2e2650ff60d90f50ecd52380f357e562efda99613
+github.com/akyoto/stringutils,v0.2.6,h1:IP+7jtH8uofpan8MYlV/WMNaLDGBRbzgiTKYnxcAwkw=,802a3b54f91b930c1e8f2376bebf783b16894da626fc7c8064268b07ab567f7c
+github.com/akyoto/tty,v0.1.3,h1:AdnLETzgooimWLvoBQLn5bT1j+i0yiB4E596BfFKnmA=,749381ec9dce8bc96bec66c5dfb0874db917a008f9685d9c65c15da43ede964c
+github.com/alcortesm/tgz,v0.0.0-20161220082320-9c5fe88206d7,h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=,ccedffb2c46724216b787fb1a79ae33fb0dfdd672c669db000c4ed5a68b08014
+github.com/alecthomas/assert,v0.0.0-20170929043011-405dbfeb8e38,h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U=,873d257170b1363142cbf5e16b49c6a21cccb3e4aaceb9d370c3b78b051a5663
+github.com/alecthomas/chroma,v0.6.8,h1:TW4JJaIdbAbMyUtGEd6BukFlOKYvVQz3vVhLBEUNwMU=,ebc5202e6a0ededc5a2c7396b01b76c050331bead9d047f31fe648cb63e68aa3
+github.com/alecthomas/colour,v0.0.0-20160524082231-60882d9e2721,h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo=,334101c562d2e74338f6baab1de04f3bbff89021d24f4206c551ef47b96a2bfe
+github.com/alecthomas/kingpin,v2.2.6+incompatible,h1:5svnBTFgJjZvGKyYBtMB0+m5wvrbUHiqye8wRJMlnYI=,a88daee47262ffeca1f6e348399c16c9be160f3c5e972c0b6c9dc275d85bcdc6
+github.com/alecthomas/kong,v0.2.1-0.20190708041108-0548c6b1afae,h1:C4Q9m+oXOxcSWwYk9XzzafY2xAVAaeubZbUHJkw3PlY=,4292d9b6903d67f060d3bd57ffca0a4ebca359824ce2d32a512ac1b963fa3dc0
+github.com/alecthomas/kong-hcl,v0.1.8-0.20190615233001-b21fea9723c8,h1:atLL+K8Hg0e8863K2X+k7qu+xz3M2a/mWFIACAPf55M=,21a34d6ee62e3419601d0e083b8829001a9833899dd3c2d27a82c794426fd0ee
+github.com/alecthomas/log4go,v0.0.0-20180109082532-d146e6b86faa,h1:0zdYOLyuQ3TWIgWNgEH+LnmZNMmkO1ze3wriQt093Mk=,04bdaa7d57a681072316927175c21ca7c9e7a19bd7fee2102b5f40e5b01a7559
+github.com/alecthomas/repr,v0.0.0-20181024024818-d37bc2a10ba1,h1:GDQdwm/gAcJcLAKQQZGOJ4knlw+7rfEQQcmwTbt4p5E=,c01a833ec56f68113f6cd7ed82b7da9bfaec641a10e929e0e3e5e5dadb1a85ad
+github.com/alecthomas/template,v0.0.0-20190718012654-fb15b899a751,h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=,25e3be7192932d130d0af31ce5bcddae887647ba4afcfb32009c3b9b79dbbdb3
+github.com/alecthomas/units,v0.0.0-20190924025748-f65c72e2690d,h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=,e6b0ccb38bfba85d90092d1c57671d5f7996757bd71f6f1970c6ae2f9dae3f6e
+github.com/alicebob/gopher-json,v0.0.0-20180125190556-5a6b3ba71ee6,h1:45bxf7AZMwWcqkLzDAQugVEwedisr5nRJ1r+7LYnv0U=,2374b534198621157afb9466a52d361b6eed33dcf9bb0674019515e64b16129e
+github.com/alicebob/miniredis,v0.0.0-20180911162847-3657542c8629,h1:gLoh8jzwIxdisBnHiWRIuReqtH9cpslSE2564UWXun0=,14b5e988ec6d8357a25ba19a7adbdb34920f5f91401b2b26eb25f04fed9893b0
+github.com/aliyun/alibaba-cloud-sdk-go,v0.0.0-20191031111935-12810c79403d,h1:CmGtZPPsr0C31ZBrzdP+D2oczTbyEBbO3bYg6z5EIDY=,4f0f25f45d954ab970b24783e31b716b619b128081acc9ed7b00727cd7c2d536
+github.com/aliyun/aliyun-oss-go-sdk,v2.0.3+incompatible,h1:724q2AmQ3m1mrdD9kYqK5+1+Zr77vS21jdQ9iF9t4b8=,47ede6a440ad4bb1a1c33d71bd12f76f44aa2487f676b8770152130be3021657
+github.com/aliyun/aliyun-tablestore-go-sdk,v4.1.2+incompatible,h1:ABQ7FF+IxSFHDMOTtjCfmMDMHiCq6EsAoCV/9sFinaM=,82c8ced9cd377462c6ea5070258f97c77ffddd66621e8960b08184eb58416846
+github.com/allegro/bigcache,v1.2.1,h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc=,9250edab8c7851cfa0c6c173e721cf70831e90742a7485c2eba1d6e2cc8c71eb
+github.com/anacrolix/envpprof,v1.1.0,h1:hz8QWMN1fA01YNQsUtVvl9hBXQWWMxSnHHoOK9IdrNY=,97f2340bcb169956bad97c59fdc17bbd2eb7c0acefe4e2ae327c7d6bd5a5f6cf
+github.com/anacrolix/log,v0.3.0,h1:Btxh7GkT4JYWvWJ1uKOwgobf+7q/1eFQaDdCUXCtssw=,e8bc14381d8746426c7e272228780047e0594d695d02e188269f1e86ef1644d4
+github.com/anacrolix/missinggo,v1.2.1,h1:0IE3TqX5y5D0IxeMwTyIgqdDew4QrzcXaaEnJQyjHvw=,2fb8cba1f6eaf69989ca5c522c2d4afd6c1071ad9459f940b6058dbfc2f3b285
+github.com/anacrolix/missinggo/perf,v1.0.0,h1:7ZOGYziGEBytW49+KmYGTaNfnwUqP1HBsy6BqESAJVw=,f4271e6359cf3dd5cba81bcf1436e8abc5d0c96c11820b881544708caa131713
+github.com/anacrolix/sync,v0.0.0-20180808010631-44578de4e778,h1:XpCDEixzXOB8yaTW/4YBzKrJdMcFI0DzpPTYNv75wzk=,bef95f54e1b17e4e7666cbf552e541e670f29fc3fd354aba0ebeee73f744ea24
+github.com/anacrolix/tagflag,v1.0.1,h1:Yd3d5DaKbRA70k7CoFuBsbmfSWIsvtZ9t80xW/x4vQY=,8fc0a5b5607cde223bacd9e4fa3b26f6166c09a09bfabe2c2c803e45e17971fa
+github.com/anacrolix/utp,v0.0.0-20180219060659-9e0e1d1d0572,h1:kpt6TQTVi6gognY+svubHfxxpq0DLU9AfTQyZVc3UOc=,35c47428844d10f077225195f9a6c7587c671b7fc70bbaf59ef74cd6d8834e32
+github.com/andreyvit/diff,v0.0.0-20170406064948-c7f18ee00883,h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=,d39614ff930006640ec15865bca0bb6bf8e1ed145bccf30bab08b88c1d90f670
+github.com/andybalholm/cascadia,v1.0.0,h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o=,7fd82e560ca1a453974a64c9bf6514b17322d1b7392bad730a5006d929996906
+github.com/andygrunwald/go-jira,v1.5.0,h1:/1CyYLNdwus7TvB/DHyD3udb52K12aYL9m7WaGAO9m4=,3ee973941f400bf95005cada54e09e319cb4943cd6c8d66480243d3b40895821
+github.com/anmitsu/go-shlex,v0.0.0-20161002113705-648efa622239,h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=,3b8376ff631f30d47e0348a8f847050b97c3db89483f45d1cd8f11d23c7c56a2
+github.com/antchfx/htmlquery,v1.0.0,h1:O5IXz8fZF3B3MW+B33MZWbTHBlYmcfw0BAxgErHuaMA=,81c86507bf2a226d5a3d20db547503d490f1e3b77035f267056e80cd73e240e2
+github.com/antchfx/xmlquery,v1.0.0,h1:YuEPqexGG2opZKNc9JU3Zw6zFXwC47wNcy6/F8oKsrM=,969fc21438fe076aee032574578158ac7e030979153dcf7b5ff5c133cbfa4d86
+github.com/antchfx/xpath,v0.0.0-20190129040759-c8489ed3251e,h1:ptBAamGVd6CfRsUtyHD+goy2JGhv1QC32v3gqM8mYAM=,22cb767dc0cafecba39e1b0322cc8aebbc6fd912e4b0fcda8c2c1dde2d80c4d2
+github.com/antchfx/xquery,v0.0.0-20180515051857-ad5b8c7a47b0,h1:JaCC8jz0zdMLk2m+qCCVLLLM/PL93p84w4pK3aJWj60=,9ddc9d830f2d6c7a22604035f0c621228ffa4ed6ff1f1d34655ee477c203c899
+github.com/antihax/optional,v0.0.0-20180407024304-ca021399b1a6,h1:uZuxRZCz65cG1o6K/xUqImNcYKtmk9ylqaH0itMSvzA=,7b0a2bf3eb029d9abe761db1874a501b60f267e675d72ae8c4b8c6f406ddcfd0
+github.com/apache/arrow/go/arrow,v0.0.0-20191024131854-af6fa24be0db,h1:nxAtV4VajJDhKysp2kdcJZsq8Ss1xSA0vZTkVHHJd0E=,4bd8443c24bc06843c0270df4f08f98b3eee6116604ff16d14dce34b242783cf
+github.com/apache/thrift,v0.13.0,h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI=,d75265e363da943c24e7ed69104bf018429024a50968421e48a6ab3e624733c2
+github.com/apex/log,v1.1.1,h1:BwhRZ0qbjYtTob0I+2M+smavV0kOC8XgcnGZcyL9liA=,5bb0f19e5c68b104ed32a311ea9c6f6e2a5e8fa597b342695e069468e2248d83
+github.com/aphistic/golf,v0.0.0-20180712155816-02c07f170c5a,h1:2KLQMJ8msqoPHIPDufkxVcoTtcmE5+1sL9950m4R9Pk=,a0ca77a50520037607c3a2a798b66aee1d5df63f4800b4236f51be2f1e3c1d70
+github.com/aphistic/gomol,v0.0.0-20190314031446-1546845ba714,h1:ml3df+ybkktxzxTLInLXEDqfoFQUMC8kQtdfv8iwI+M=,c2fd1a9db2fb7a5ca7ba9132fbddb5d8efd64babcff7c0f66d41d3cf97b8caab
+github.com/aphistic/gomol-console,v0.0.0-20180111152223-9fa1742697a8,h1:tzgowv45TOFALtZLJ9y3k+krzOh2J8IkCvJ8T//6VAU=,26a1b99db9a92a7f5d088e529c43db6de957a3a1650c27d7a872495f73a52880
+github.com/aphistic/gomol-gelf,v0.0.0-20170516042314-573e82a82082,h1:PgPqI/JnStmzwTof+PtT53Pz53dlrz2BmF7cn5CAwQM=,e44d4de8d62391c1e0e70c3b27f4c341bb0398083f33b99be46e29144fad3c50
+github.com/aphistic/gomol-json,v1.1.0,h1:XJWwW8PxYOHf0f0FquuBWcgvZBvQ89nPxZsqQ9pfpro=,0e1ab66a46afe81c4662f8a49ca38042f0c6bc8645895336399adef1eedaff59
+github.com/aphistic/sweet,v0.2.0,h1:I4z+fAUqvKfvZV/CHi5dV0QuwbmIvYYFDjG0Ss5QpAs=,02bebcef905b02cf7195137d9b20920367bb5f8c635a6e5a112b787596414f51
+github.com/aphistic/sweet-junit,v0.0.0-20190314030539-8d7e248096c2,h1:qDCG/a4+mCcRqj+QHTc1RNncar6rpg0oGz9ynH4IRME=,6a3ab195b97bd1981f2ae87a172bc24ecfb44ffbd8d28428f97bfa46e66f559b
+github.com/apparentlymart/go-cidr,v1.0.1,h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U=,5af128e1ecdf5f2203fda104a653f13fb2e46acc3f68b2d7634a760a8f556ea0
+github.com/apparentlymart/go-dump,v0.0.0-20190214190832-042adf3cf4a0,h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I=,3506757fd2dcbcf8e77aa962c923d9ceaf918538bf9b117f98aa562bc83c77ef
+github.com/apparentlymart/go-textseg,v1.0.0,h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0=,2572a77af285125f1980e9b751e5a7c3ae59b73c4fc97e7c2407681609991142
+github.com/appc/spec,v0.8.11,h1:BFwMCTHSDwanDlAA3ONbsLllTw4pCW85kVm290dNrV4=,4a17d699b3e2c3cc8b301de260a45c8fc31054fbb5c689e567f24e3e63bf8f79
+github.com/apple/foundationdb/bindings/go,v0.0.0-20190411004307-cd5c9d91fad2,h1:VoHKYIXEQU5LWoambPBOvYxyLqZYHuj+rj5DVnMUc3k=,a2dc6bd23d9066d3acf174c9b33378c08ae4a95cfd017abc70a16388e74ea2c3
+github.com/approvals/go-approval-tests,v0.0.0-20160714161514-ad96e53bea43,h1:ePCAQPf5tUc5IMcUvu6euhSGna7jzs7eiXtJXHig6Zc=,e3b51ab88c4f3b1c4aea2fadd0b3d3e2ec178d37232066b9fe3b0177e1c6e9aa
+github.com/aquasecurity/fanal,v0.0.0-20191031102512-c1c079886da6,h1:B84l/SNXzzcqwgIORAmEv7gs4K4l+DJkdliI6ib/zNw=,7247188e1746360364e7ff77aa0c531df69074c49b23e7f67d65134ca577b0e0
+github.com/aquasecurity/go-dep-parser,v0.0.0-20190819075924-ea223f0ef24b,h1:55Ulc/gvfWm4ylhVaR7MxOwujRjA6et7KhmUbSgUFf4=,73ce01b48b9aa56349d928a27bdd4b77c149541385e645951b2e25f1d6ab5d26
+github.com/araddon/dateparse,v0.0.0-20190622164848-0fb0a474d195,h1:c4mLfegoDw6OhSJXTd2jUEQgZUQuJWtocudb97Qn9EM=,3b88bff198316e2795d11340862ef873387cd7dba97eeb17f106f41deb00d602
+github.com/araddon/gou,v0.0.0-20190110011759-c797efecbb61,h1:Xz25cuW4REGC5W5UtpMU3QItMIImag615HiQcRbxqKQ=,936e20f4c9eaa45f54586ab86bce911f0b1f935d0410dd683dc647797ed7225d
+github.com/aristanetworks/fsnotify,v1.4.2,h1:it2ydpY6k0aXB7qjb4vGhOYOL6YDC/sr8vhqwokFQwQ=,9c0dd5427e82f044a9e5808a3436b43472ff032f23ac853829e5c166171044a3
+github.com/aristanetworks/glog,v0.0.0-20180419172825-c15b03b3054f,h1:Gj+4e4j6g8zOhckHfGbZnpa0k8yDrc0XRmiyQj2jzlU=,496dd08756b324a7925b670a907328433f1477763a229b76a4eef8ed254c9683
+github.com/aristanetworks/goarista,v0.0.0-20191023202215-f096da5361bb,h1:gXDS2cX8AS8KbnP32J6XMSjzC1FhHEdHfUUCy018VrA=,2c348fcdf827ac0d1238fb556f66ad1f13f05d8c5a6d2b3efe5f94be40af5021
+github.com/aristanetworks/splunk-hec-go,v0.3.3,h1:O7zlcm4ve7JvqTyEK3vSBh1LngLezraqcxv8Ya6tQFY=,545adec43ebdf1c9cdc65cd3d738d131f1b02706d25876de1fda65c4989195af
+github.com/armon/circbuf,v0.0.0-20190214190532-5111143e8da2,h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs=,c8b7ba977844b5378a2413c123c3e55d0885fb67f64ad6cf06575a791a36b827
+github.com/armon/consul-api,v0.0.0-20180202201655-eb2c6b5be1b6,h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA=,091b79667f16ae245785956c490fe05ee26970a89f8ecdbe858ae3510d725088
+github.com/armon/go-metrics,v0.0.0-20190430140413-ec5e00d3c878,h1:EFSB7Zo9Eg91v7MJPVsifUysc/wPdN+NOnVe6bWbdBM=,3d48bc38dda0cff4dbf0b56b9b6e2e8fc3e6be2282f2a612a96a6702cc8a9fc5
+github.com/armon/go-proxyproto,v0.0.0-20190211145416-68259f75880e,h1:h0gP0hBU6DsA5IQduhLWGOEfIUKzJS5hhXQBSgHuF/g=,1004212be9a343c99e1849425845af1ec5e3e35cc4917483721cb03620982d58
+github.com/armon/go-radix,v1.0.0,h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=,df93c816505baf12c3efe61328dc6f8fa42438f68f80b0b3725cae957d021c90
+github.com/armon/go-socks5,v0.0.0-20160902184237-e75332964ef5,h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=,f473e6dce826a0552639833cf72cfaa8bc7141daa7b537622d7f78eacfd9dfb3
+github.com/asaskevich/govalidator,v0.0.0-20190424111038-f61b66f89f4a,h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=,b5dfb936e0256459bc633c8acf433f4a01a468868db9bd6e390a67f4678185f5
+github.com/asdine/storm,v2.1.2+incompatible,h1:dczuIkyqwY2LrtXPz8ixMrU/OFgZp71kbKTHGrXYt/Q=,ffea8b759006a871732554e1e0a42753fb9a5dd9884eb150e1b42806d51cd5fd
+github.com/assetsadapterstore/tivalue-adapter,v1.0.3,h1:zcFcT1x1rWDYQEaA3wI7Hr7F25Cspy+O1cr+vUMjrks=,c42adddd544495ef0ebe1d8730bad20c4251c7646e1782542782bc946c839eca
+github.com/astaxie/beego,v1.12.0,h1:MRhVoeeye5N+Flul5PoVfD9CslfdoH+xqC/xvSQ5u2Y=,1f14eb5d216170c027754bea1129bbcdafc06a035650e635375c61a17be6f316
+github.com/asticode/go-astilog,v1.0.0,h1:l9tek0K7KoQCmhZ7cvBTtVu0NsKpS9hB6jBLtQyxWYk=,49fe2b286073848e780a9326f7d37771372e61827ff07b80db89667e6ac4d1d4
+github.com/aws/amazon-ssm-agent,v0.0.0-20191011205301-04bb0617297b,h1:xv695CeRjoBS0baQSS5UfQkeo63GiMjmDwiAeY09bSw=,08ede8d7aa20210a4738e0ea033f1bf8fd1ce13bba6c375431c8c1e7a8565c37
+github.com/aws/aws-lambda-go,v1.13.2,h1:8lYuRVn6rESoUNZXdbCmtGB4bBk4vcVYojiHjE4mMrM=,05b1633366a8df9e313df4409d003a277ff7ae46f1079b3ad7f6b48c0dabfb75
+github.com/aws/aws-sdk-go,v1.25.25,h1:j3HLOqcDWjNox1DyvJRs+kVQF42Ghtv6oL6cVBfXS3U=,c34d718d97487766a9a8ac818d37dd135d75d747a8d191a616b75425c32456f2
+github.com/aybabtme/rgbterm,v0.0.0-20170906152045-cc83f3b3ce59,h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo=,a4456a42277e0c987de99e9c4ba141db064107ce737ad1dd2e050aeb1149b67e
+github.com/aymerick/raymond,v2.0.2+incompatible,h1:VEp3GpgdAnv9B2GFyTvqgcKvY+mfKMjPOA3SbKLtnU0=,df6e22632cb314b76ab10dd6a1c2c66a79da44200bfec9f5e4f321100d90dc64
+github.com/baiyubin/aliyun-sts-go-sdk,v0.0.0-20180326062324-cfa1a18b161f,h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA=,0965da027355d9b385358331ec359cf729ec4571ec4ca86339da925364c13559
+github.com/bartekn/go-bip39,v0.0.0-20171116152956-a05967ea095d,h1:1aAija9gr0Hyv4KfQcRcwlmFIrhkDmIj2dz5bkg/s/8=,6a278508499838d4c57c1dbdafcfc9f9f909e7358c518a8699728053b695d0c5
+github.com/bazelbuild/buildtools,v0.0.0-20191024175656-9f3978593d3e,h1:QdfIPgk+fJY8AcfjVk2/tdc2dNtl6d+7x8dhVBP72Ik=,f768dd2a38a1dedc924740f9b7a3194ca68d8a24db8fb840c547aee3911162d3
+github.com/bbangert/toml,v0.0.0-20130821181452-a2063ce2e5cf,h1:SGoM2ypzNnI+hMs01svW6wRddndk7eWRs1Bx1zOGRTI=,63690dcb3fcf13b55193cfe263b4a4fdbbe2ee9d7f93440375815dac28d34cb9
+github.com/bcext/cashutil,v0.0.0-20190126062106-1194a0af0582,h1:+sgikGWB0jvS9rzLlPww+SSFoieOLB8yieXyX9DRCF4=,4d5b42e5d472015edeef1b6bf54e253a85bab6df1ac16aabea7fd0dea4aa85e3
+github.com/bcext/gcash,v0.0.0-20190404152342-2e38815af4f2,h1:XVuqYNixmuo81vR/PnBRDDiTH7596mAwQlQ8BucvGnM=,6b24e00369a493c32e730a4d78d8c4fd122ffe0ce319c5d72f3c7d2f12ede4b7
+github.com/beego/goyaml2,v0.0.0-20130207012346-5545475820dd,h1:jZtX5jh5IOMu0fpOTC3ayh6QGSPJ/KWOv1lgPvbRw1M=,aaa4165412caaacbb2df4427207a206e09215c3f7a19f8309e9222ca9ff80691
+github.com/beego/x2j,v0.0.0-20131220205130-a0352aadc542,h1:nYXb+3jF6Oq/j8R/y90XrKpreCxIalBWfeyeKymgOPk=,f9a32026b2107f3cc3610ac6b75c4c64818646a316c35e648c8811d4276a9993
+github.com/beevik/etree,v1.1.0,h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs=,614a33736f8b9262a809f101df5bf71f47777879b1191165b6247d6b67c7468c
+github.com/beevik/guid,v0.0.0-20170504223318-d0ea8faecee0,h1:oLd/YLOTOgA4D4aAUhIE8vhl/LAP1ZJrj0mDQpl7GB8=,5add94fcade6c7afa236112c8da300d47ec499ad1789a5e805c8198062dd0749
+github.com/beevik/ntp,v0.2.0,h1:sGsd+kAXzT0bfVfzJfce04g+dSRfrs+tbQW8lweuYgw=,42e14f30c23ba2f5ddaff76101016d87f0f0a0f1d96d3d20e42fd02842091c76
+github.com/belogik/goes,v0.0.0-20151229125003-e54d722c3aff,h1:/kO0p2RTGLB8R5gub7ps0GmYpB2O8LXEoPq8tzFDCUI=,f926f1040febe5318efa145541a6fc7898d32514bc13899e812185f05710c5db
+github.com/beorn7/perks,v1.0.1,h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=,25bd9e2d94aca770e6dbc1f53725f84f6af4432f631d35dd2c46f96ef0512f1a
+github.com/bep/debounce,v1.2.0,h1:wXds8Kq8qRfwAOpAxHrJDbCXgC5aHSzgQb/0gKsHQqo=,ddc0a77e4819b6b826d69fdf1a5a153f3f867a31e030cfe28296355b670adf21
+github.com/bep/gitmap,v1.1.1,h1:Nf8ySnC3I7/xPjuWeCwzukUFv185iTUQ6nOvLy9gCJA=,364163e67741ae331d164fd881964160f19fdbdfe094e0e762314cc37aac646a
+github.com/bep/go-tocss,v0.6.0,h1:lJf+nIjsQDpifUr+NgHi9QMBnrr9cFvMvEBT+uV9Q9E=,40e7175da9564796e184e4383bfce703f63244b850999b5a54fd5792bfc5baf5
+github.com/bep/tmc,v0.5.0,h1:AP43LlBcCeJuXqwuQkVbTUOG6gQCo04Et4dHqOOx4hA=,f8e0be71fb845a4ca22825f5b9c51c1a66c29e9ccff723e063781ee64c664c66
+github.com/bgentry/go-netrc,v0.0.0-20140422174119-9fd32a8b3d3d,h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas=,59fbb1e8e307ccd7052f77186990d744284b186e8b1c5ebdfb12405ae8d7f935
+github.com/bgentry/speakeasy,v0.1.0,h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY=,d4bfd48b9bf68c87f92c94478ac910bcdab272e15eb909d58f1fb939233f75f0
+github.com/bifurcation/mint,v0.0.0-20180715133206-93c51c6ce115,h1:fUjoj2bT6dG8LoEe+uNsKk8J+sLkDbQkJnB6Z1F02Bc=,40a4bd02b9e3477271638bc17ae8537e2675ace0a9b85d753820e979dbf97f36
+github.com/binance-chain/go-sdk,v1.0.8,h1:mC1Tai9diqIWuKTJmrFLal90OCsgtDvyLEItMvglaHA=,3d0f86f959b38f11174d8ee574e77e5d80d2c672d0720dee519f3708e873b0ca
+github.com/binance-chain/ledger-cosmos-go,v0.9.9-binance.1,h1:8mAtw1Tp/BhhTrsXmXM60H1fihcvcKLfo2ZSxShaXKw=,f6dc2bfb4d29db01cad72815615301e089d727110d1d5a0de43e829953e45041
+github.com/biogo/hts,v0.0.0-20160420073057-50da7d4131a3,h1:3b+p838vN4sc37brz9W2HDphtSwZFcXZwFLyzm5Vk28=,93be93b79da8920fb5f02bb2e50a364e2b33dc831229d163e7be70c1010cdb9e
+github.com/bitcoinsv/bsvd,v0.0.0-20190609155523-4c29707f7173,h1:2yTIV9u7H0BhRDGXH5xrAwAz7XibWJtX2dNezMeNsUo=,8e1e554ddc232e763fac27ddc0661cfe543163802b0d6bb9a2904bf24756ddc3
+github.com/bitcoinsv/bsvlog,v0.0.0-20181216181007-cb81b076bf2e,h1:6f+gRvaPE/4h0g39dqTNPr9/P4mikw0aB+dhiExaWN8=,89f0c34e6936d82a1629d5d255923ff27c0adeb99709269cf62071e48cb5fbd8
+github.com/bitcoinsv/bsvutil,v0.0.0-20181216182056-1d77cf353ea9,h1:hFI8rT84FCA0FFy3cFrkW5Nz4FyNKlIdCvEvvTNySKg=,4d4923e8743012e1f8ed1a1ef721786fc2d5249cc5dafd96fdd350c485378cfe
+github.com/bitly/go-hostpool,v0.0.0-20171023180738-a3a6125de932,h1:mXoPYz/Ul5HYEDvkta6I8/rnYM5gSdSV2tJ6XbZuEtY=,9a55584d7fa2c1639d0ea11cd5b437786c2eadc2401d825e699ad6445fc8e476
+github.com/bitly/go-simplejson,v0.5.0,h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y=,53930281dc7fba8947c1b1f07c82952a38dcaefae23bd3c8e71d70a6daa6cb40
+github.com/blackducksoftware/horizon,v0.0.0-20190625151958-16cafa9109a3,h1:noI1RY2cUFZfdZMIz1+1LzT8ZeuWK703gwmH/ZC2YnQ=,ece353e9e973ce03d131b29c6c00aea53f1b2e507960b389cdfeb2cc317897ef
+github.com/blacktear23/go-proxyprotocol,v0.0.0-20180807104634-af7a81e8dd0d,h1:rQlvB2AYWme2bIB18r/SipGiMEVJYE9U0z+MGoU/LtQ=,123c82a455309b3a3118504c0a70771352292abced294dca39a570b89e48adba
+github.com/blakesmith/ar,v0.0.0-20190502131153-809d4375e1fb,h1:m935MPodAbYS46DG4pJSv7WO+VECIWUQ7OJYSoTrMh4=,015878daba57ba5ce7228f772b843fffa847d99c7afeb308089bef77f433c510
+github.com/blang/semver,v3.5.1+incompatible,h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=,8d032399cf835b93f7cf641b5477a31a002059eed7888a775f97bd3e9677ad3c
+github.com/blevesearch/bleve,v0.8.1,h1:20zBREtGe8dvBxCC+717SaxKcUVQOWk3/Fm75vabKpU=,58a5b5ade8123d54b7510e463c25e1e59e6cd3d98acdcb4d582c42db67c03519
+github.com/blevesearch/blevex,v0.0.0-20180227211930-4b158bb555a3,h1:U6vnxZrTfItfiUiYx0lf/LgHjRSfaKK5QHSom3lEbnA=,defa5966f802eab571cc8d9315323104b776751dd13caae9d8fc0476576d57ca
+github.com/blevesearch/go-porterstemmer,v0.0.0-20141230013033-23a2c8e5cf1f,h1:J9ZVHbB2X6JNxbKw/f3Y4E9Xq+Ro+zPiivzgmi3RTvg=,e13cc37d08c58870cdbad544b726934cd62ca6aa2ae35f02598f72e30d7c0f59
+github.com/blevesearch/segment,v0.0.0-20160105220820-db70c57796cc,h1:7OfDAkuAGx71ruzOIFqCkHqGIsVZU0C7PMw5u1bIrwU=,21278826e6ba0f63024a953c480467bf41d6717ae4a87c3021a9f74d2f2ae618
+github.com/blocktree/arkecosystem-adapter,v1.0.4,h1:TkZWCzAgi20CjAMlOpwTDppt6XO7X8Fn5EjSUsuB6kI=,22346af6957b0b8fae47d982605f565e5e16e86bc52a9fdd234b023067896cf2
+github.com/blocktree/bitshares-adapter,v1.0.5,h1:mzYlpip0crtYaDaXbKqtGLAxad83p19HLTVa9LLW3fc=,03ce80398ab59af79feb92b054e5da02a290ef27aef5facb93cdd86de2e0df91
+github.com/blocktree/ddmchain-adapter,v1.0.5,h1:Lx8zD0lOHb9TJ7EcGJQhyvpDkYko6OoV8uwudKRKlJA=,81e65ed5692152fcaa1dbf997f71dc43192abc72dad6fb78b721d742c05c1a7a
+github.com/blocktree/eosio-adapter,v1.0.0,h1:cncKE4QbQxDsr8B+HlhU7tywbCtZRsWMln2ek8I5lbc=,cc658d6f9fa5470c5affb4caad58e17637a6d46f8e5d1b3730ed06e570e61959
+github.com/blocktree/ethereum-adapter,v1.1.10,h1:PkmQeRT5ljyCOQZPT0diJo+4G9OqOcJsnRcXeF5fitU=,cf8465db958e214c8196e6311fd5db24f8d28265a37914c2cf9d2dac54a5fd1a
+github.com/blocktree/futurepia-adapter,v1.0.12,h1:mL1rDvcM55hKwLhHOkg1v2GwnCEsDniUrqrMG3PK/+4=,ae29bbdb9a4a1ec345f7d220d6a736ed827a307454d0466bb065dacf3d94200d
+github.com/blocktree/go-owcdrivers,v1.1.18,h1:KCNm+HczpDfxyUf+Wrvbj/iWwQDJ+ca/FBjm3H06rIY=,65bcca1918d8b9e1048bac14b1393dec246402320b6a5dde20ee6afe84585736
+github.com/blocktree/go-owcrypt,v1.0.3,h1:qfAwJsWYp7WaI26hAwPuFUrMXhD9bWwuGXYWBOLsVes=,f365daad6adfcc5aee14faa1455f772b5e39b1c9ff3598afb1c3645587cb6b2e
+github.com/blocktree/moacchain-adapter,v1.0.3,h1:k9drMeekvBsXORortW/zJXaO6CokXVv2EL0/YK3c1/A=,66c87656369c5246bad1527f7385d1cb98bbeda431383f154a23e9bf821a05a2
+github.com/blocktree/nulsio-adapter,v1.1.7,h1:d0xuovBqodBAv8BE/CPZjfe5CNma6FFSP6W3ynJRD0U=,c814c05686483abc345bf4fb997fc61595e738b99cc8a8d36742414f93e948b0
+github.com/blocktree/ontology-adapter,v1.0.8,h1:Lej35ZPPgjS6nP5CEumIUskRNASMZswgrByYSxrWPe0=,fcdeb4c6d8f37a22f52e2938ebc51b4ff1f4cf4116eebce8ecc7591995236853
+github.com/blocktree/openwallet,v1.5.3,h1:6hNj61wLfzEGqbbY0ZOeqGAjSj9snoRSBikgSlWPqZI=,1f169b69cd3ec4a4f82836c2b2178eb162464d6413c09f8170f73a838d28650b
+github.com/blocktree/ripple-adapter,v1.0.13,h1:zgJt7onq5+V6pvQ7Kl3xiiSkk3uxuCF07OpwCtJTM8w=,bb7f515a6573eb185da0bebb28bf57364d175ee7f937e18af5b2eac98741464f
+github.com/blocktree/virtualeconomy-adapter,v1.1.5,h1:YJ2JKUifSsCjCneM0NUky3WbG0LEm7IKUBmf9EAmAXc=,7a5085b8b0b114e2491032ec6f95e300c28fa309ec5883044d8b954d7d4db06e
+github.com/blocktree/waykichain-adapter,v1.0.3,h1:qY/Txh+n4iIJA49rDMj41qpIUj3McjBir8Ls+sX8c3w=,62ea2ff873c84a32d3482c8ec1687221a1e46055b9be18fcd25be584cf2cac5d
+github.com/bluele/gcache,v0.0.0-20190518031135-bc40bd653833,h1:yCfXxYaelOyqnia8F/Yng47qhmfC9nKTRIbYRrRueq4=,334accb65479b1b18fb569b08d14eebceb6478ea16abe9fbad2f1c6b6586deb6
+github.com/bluele/slack,v0.0.0-20180528010058-b4b4d354a079,h1:dm7wU6Dyf+rVGryOAB8/J/I+pYT/9AdG8dstD3kdMWU=,2b0055c292b7baa49f56eb9fc710f35f005747ddbef16427d5c985617c3b697d
+github.com/bmatcuk/doublestar,v1.1.5,h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk=,81f592b11277591e943b91522497c323fcf0c6b4f3099f495de10f83e8c3e697
+github.com/bmizerany/assert,v0.0.0-20160611221934-b7ed37b82869,h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=,2532a167df77ade7e8012f07c0e3db4d4c15abdb7ffa7b05e1d961408da9a539
+github.com/bmizerany/pat,v0.0.0-20170815010413-6226ea591a40,h1:y4B3+GPxKlrigF1ha5FFErxK+sr6sWxQovRMzwMhejo=,ed04bed4d193e25371ebc6524984da4af9ece5c107fcc82d5aa4914b726706d2
+github.com/bndr/gotabulate,v1.1.2,h1:yC9izuZEphojb9r+KYL4W9IJKO/ceIO8HDwxMA24U4c=,2c1ecc544368e40010082f800c1ee24eaf1b8e0f96fa76a56e4f61dda4cd0d60
+github.com/boltdb/bolt,v1.3.1,h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=,ecaf17b0dbe7c85a017704c72667b2526b492b1a753ce7302a27dd2fb2e6ee79
+github.com/boombuler/barcode,v1.0.0,h1:s1TvRnXwL2xJRaccrdcBQMZxq6X7DvsMogtmJeHDdrc=,ef3832c4d22a09377323980bacd9f5f2ab43d0d20da115e1cfb139e093d7bb9b
+github.com/bradfitz/go-smtpd,v0.0.0-20170404230938-deb6d6237625,h1:ckJgFhFWywOx+YLEMIJsTb+NV6NexWICk5+AMSuz3ss=,0a06dd547fed38e2744800b5f4ebae5ac00ee08717ded281510a8d319b8db8f3
+github.com/bradfitz/gomemcache,v0.0.0-20190913173617-a41fca850d0b,h1:L/QXpzIa3pOvUGt1D1lA5KjYhPBAN/3iWdP7xeFS9F0=,eb71acfac0c4ce5f0b6537d8029de98902d83fd38fdcbfd757f06697c6323f78
+github.com/bradfitz/iter,v0.0.0-20190303215204-33e6a9893b0c,h1:FUUopH4brHNO2kJoNN3pV+OBEYmgraLT/KHZrMM69r0=,6883ce0960849ca9c024a4a4e7508ff521da2a3bb66d1974ea2f970a5265ea39
+github.com/bradfitz/latlong,v0.0.0-20140711231157-b74550508561,h1:mz4equOOUOnI4q5E7dyHlRx1x63YEaYwhlVluCDila4=,d1c124508f1825697a2bdb9fac48d2b8805b41f8e546d262fc487d8450962cec
+github.com/bradhe/stopwatch,v0.0.0-20180424000511-fd55e776a960,h1:YJWTgxlTgeHlvhe7tZJm0yBcg2GhjDQs8zig5O5vup8=,c2926a4febee7eea0f523b3d4fcaa414c27effc2abc053137a3dbf0b3a4fa324
+github.com/briankassouf/jose,v0.9.2-0.20180619214549-d2569464773f,h1:ZMEzE7R0WNqgbHplzSBaYJhJi5AZWTCK9baU0ebzG6g=,c0b50157ec3c39fbd6ded9d5e6bc763890e6d909db38b337a72876124c2baeeb
+github.com/brocaar/lorawan,v0.0.0-20190925120821-154a30dbdce2,h1:51WcQ+VAc/6jZ/8GBJiQ3B7FrT2aXI+YsUx2iG9tJlw=,0082cebaf26ed36c901f9b44b6d785eccc2a0c123088642eac7c9b5711b7d0ca
+github.com/bsm/go-vlq,v0.0.0-20150828105119-ec6e8d4f5f4e,h1:D64GF/Xr5zSUnM3q1Jylzo4sK7szhP/ON+nb2DB5XJA=,61fc03674cd72d5a4c55413e8b58fc8eafc58fbb71fb89c719225650754b3469
+github.com/bsm/sarama-cluster,v2.1.15+incompatible,h1:RkV6WiNRnqEEbp81druK8zYhmnIgdOjqSVi0+9Cnl2A=,a8a4867f09704222362b75fa00c9894106a928dc7cf905f1b80ca7bbd1a3b8e5
+github.com/btcsuite/btclog,v0.0.0-20170628155309-84c8d2346e9f,h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=,74ad4defbabf48c98bbb547be1c40c11fa2c286f599412c774d1c5604dc1808d
+github.com/btcsuite/btcutil,v0.0.0-20190425235716-9e5f4b9a998d,h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng=,de1ee450ff2cfec2df220fec0d3e265cc812f214892bfad601e142632e2cf3f9
+github.com/btcsuite/go-socks,v0.0.0-20170105172521-4720035b7bfd,h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw=,cc27776f56f7c58c2808af55781e9b3f7d0eb0dc08e4c19c38c6bdf2465ce0e7
+github.com/btcsuite/goleveldb,v1.0.0,h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4=,13e37462cb2fe5976221f57d357051c1c3cc63a9b0e67e6ed97f98af795d0815
+github.com/btcsuite/snappy-go,v1.0.0,h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE=,d136165bdbf91780ded5d3ebaba9026f900595e56c19aa0ef29896015eae9627
+github.com/btcsuite/websocket,v0.0.0-20150119174127-31079b680792,h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc=,d45ac16f59082ac369e61c7bbe23153e289cad03619ab8041963d54cd700d6f0
+github.com/btcsuite/winsvc,v1.0.0,h1:J9B4L7e3oqhXOcm+2IuNApwzQec85lE+QaikUcCs+dk=,6893f7a62faec17d7b0856c7464754cab14c4d913e27af5276f6a98b25f3c779
+github.com/buger/jsonparser,v0.0.0-20191004114745-ee4c978eae7e,h1:oJCXMss/3rg5F6Poy9wG3JQusc58Mzk5B9Z6wSnssNE=,7e2dda4c1b4217408903f3b4a1f2cdd93d71bc7682387ba860cfa0cc9fcf88be
+github.com/bugsnag/bugsnag-go,v1.5.3,h1:yeRUT3mUE13jL1tGwvoQsKdVbAsQx9AJ+fqahKveP04=,8aaf02df2c1a4e8a5725eea1d91af69c4f9e157c2559a3452388f64a977534c0
+github.com/bugsnag/panicwrap,v1.2.0,h1:OzrKrRvXis8qEvOkfcxNcYbOd2O7xXS2nnKMEMABFQA=,75357d3a5cd89dc04f1f101e02686fc1ef33b4a4f67edb82b3fa63fded3f47e9
+github.com/bwmarrin/discordgo,v0.20.1,h1:Ihh3/mVoRwy3otmaoPDUioILBJq4fdWkpsi83oj2Lmk=,616d49cc107ccd85872b6008f028c4aca021f66381828bb921f15f9e8149988a
+github.com/bwmarrin/snowflake,v0.0.0-20180412010544-68117e6bbede,h1:lTJlWdyhwqq7h29GtuIDHW/xi+sMN+JOLMgYAwQ5O74=,2e13ad82f7ae64821f9851a66b4800f1589e413b27b469f28d21970957a3c6da
+github.com/c-bata/go-prompt,v0.2.2,h1:uyKRz6Z6DUyj49QVijyM339UJV9yhbr70gESwbNU3e0=,ffe765d86d90afdf8519def13cb027c94a1fbafea7a18e9625210786663436c4
+github.com/c2h5oh/datasize,v0.0.0-20171227191756-4eba002a5eae,h1:2Zmk+8cNvAGuY8AyvZuWpUdpQUAXwfom4ReVMe/CTIo=,b5543f3e104a84e35ac51780968282b455dd30c88730d0da166d8d6512301da6
+github.com/caarlos0/ctrlc,v1.0.0,h1:2DtF8GSIcajgffDFJzyG15vO+1PuBWOMUdFut7NnXhw=,e4b5e9dd37cee2d47ff1c5eeba9a4b6e2b778c349a3615ca9653531f035a3ca6
+github.com/cactus/go-statsd-client/statsd,v0.0.0-20191030180650-a68a2246f89c,h1:rrLWPlpOKwnBpVUXitbgM3+Nie1eBaFfBZqfiPpxVj8=,cbb94149ec688419a91406b374955946c3679b1dde0752d7c0ffdc87432cd0b3
+github.com/caddyserver/caddy,v1.0.3,h1:i9gRhBgvc5ifchwWtSe7pDpsdS9+Q0Rw9oYQmYUTw1w=,029f14052f1ec9937c4028f3231899bf5391d5eeb7f58795d5d470a6f4c338a7
+github.com/campoy/unique,v0.0.0-20180121183637-88950e537e7e,h1:V9a67dfYqPLAvzk5hMQOXYJlZ4SLIXgyKIE+ZiHzgGQ=,4bc20f70e0b170ecdabd740a5de012d05f4c9149e2882fbdb303dc1b1793a77e
+github.com/casbin/casbin,v1.9.1,h1:ucjbS5zTrmSLtH4XogqOG920Poe6QatdXtz1FEbApeM=,e2ef71d15eb595374d27961d255941b50691f9eaa91b5590f081fe3a4ab195c2
+github.com/cavaliercoder/go-cpio,v0.0.0-20180626203310-925f9528c45e,h1:hHg27A0RSSp2Om9lubZpiMgVbvn39bsUmW9U5h0twqc=,08b68e1d424b545418828c05c46bce5d795bbb8b534871667650ec6b3e7b33a6
+github.com/cenk/backoff,v2.2.1+incompatible,h1:djdFT7f4gF2ttuzRKPbMOWgZajgesItGLwG5FTQKmmE=,e3d1c641f85f548370aedc6bae3d4b975b09e3b2d1d9060f0e72bd5e2710d4c9
+github.com/cenkalti/backoff,v2.2.1+incompatible,h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=,f8196815a1b4d25e5b8158029d5264801fc8aa5ff128ccf30752fd169693d43b
+github.com/cenkalti/backoff/v3,v3.0.0,h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c=,c69bf77e7b43cb3935d763c24af3810d9869a664bbcd26ffad9d3dc1bf602006
+github.com/census-instrumentation/opencensus-proto,v0.2.1,h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=,b3c09f3e635d47b4138695a547d1f2c7138f382cbe5a8b5865b66a8e08233461
+github.com/centrify/cloud-golang-sdk,v0.0.0-20190214225812-119110094d0f,h1:gJzxrodnNd/CtPXjO3WYiakyNzHg3rtAi7rO74ejHYU=,dc3de1393d7ae63ce35393630417ff8c5421a2a03cbf1a20680c7d57a74cd311
+github.com/certifi/gocertifi,v0.0.0-20180118203423-deb3ae2ef261,h1:6/yVvBsKeAw05IUj4AzvrxaCnDjN4nUqKjW9+w5wixg=,054d6c3a6f8d78fba2f08fbc2f23ec839d5a4aead4a184270d87d095c80eb6dc
+github.com/cespare/cp,v1.1.1,h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU=,25f2ed5bac9ac3c1891ff364b213f6b7b0ee2e7aed13510738ced93ea71860e3
+github.com/cespare/xxhash,v1.1.0,h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=,fe98c56670b21631f7fd3305a29a3b17e86a6cce3876a2119460717a18538e2e
+github.com/cespare/xxhash/v2,v2.1.0,h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA=,655feb22a395d9f56315280770d386eb99cdca79a97970812dbd3b30a7940638
+github.com/chaseadamsio/goorgeous,v0.0.0-20170901132237-098da33fde5f,h1:REH9VH5ubNR0skLaOxK7TRJeRbE2dDfvaouQo8FsRcA=,f81f4ef8ac52852b232ea971d009ec88007f1258c29e10e49918a31a99c6c4cc
+github.com/checkpoint-restore/go-criu,v0.0.0-20190109184317-bdb7599cd87b,h1:T4nWG1TXIxeor8mAu5bFguPJgSIGhZqv/f0z55KCrJM=,1d1f5c6e529c87259305d8ed6bf4d381dabbf85458de187981204339e251a5be
+github.com/cheekybits/genny,v1.0.0,h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE=,770f3e01425b9b0a87a5e0b29fc6ac2cfa67a3f1265aafb16c96a47bafc304e4
+github.com/cheekybits/is,v0.0.0-20150225183255-68e9c0620927,h1:SKI1/fuSdodxmNNyVBR8d7X/HuLnRpvvFO0AgyQk764=,f7bf9ac5b1fc574ef5a373382909af550ef1a7f01182469eaa12e18c7c5fc7cb
+github.com/cheggaaa/pb,v2.0.7+incompatible,h1:gLKifR1UkZ/kLkda5gC0K6c8g+jU2sINPtBeOiNlMhU=,383b717f271a2471e57ac52f64dbb77304ec1c0b53c5efeb7a1392668f59d0b4
+github.com/cheggaaa/pb/v3,v3.0.1,h1:m0BngUk2LuSRYdx4fujDKNRXNDpbNCfptPfVT2m6OJY=,781be3118614dfaeb2df44d31d8af36c703c2aaed18e9ca49fa4ef9ba1539236
+github.com/chewxy/hm,v1.0.0,h1:zy/TSv3LV2nD3dwUEQL2VhXeoXbb9QkpmdRAVUFiA6k=,68ab03d9f8cb3d92d6c8234cfd879004be2fd69457d2c9fa6834d1c6ddb22b43
+github.com/chewxy/math32,v1.0.4,h1:dfqy3+BbCmet2zCkaDaIQv9fpMxnmYYlAEV2Iqe3DZo=,7885f637bb90729d04f125e030542b9a6999f9e5dffd3294baffbcdd548bbc3e
+github.com/chrismalek/oktasdk-go,v0.0.0-20181212195951-3430665dfaa0,h1:CWU8piLyqoi9qXEUwzOh5KFKGgmSU5ZhktJyYcq6ryQ=,094a132bc1e950677f75e570b17a52f103edd6acd3ec1c0943cf9cda3cd6355a
+github.com/chromedp/cdproto,v0.0.0-20191009033829-c22f49c9ff0a,h1:AuIGvB6IuWpMEdfKQ+t77D6dzLpNftzxAsktehYyWn8=,bf85eeebdc65b1e90d851b42f56a3dbf5bcff4923aa426692a1c0d0a1727a522
+github.com/chromedp/chromedp,v0.5.1,h1:PAqhoCWCHzRphYnmmxLSiYk7EEwDplCm4woTCCaV2cQ=,59cd1ab42eeb90e32cc60e77a8fbb19ca629603200d5bd40d611f780e646062b
+github.com/chzyer/logex,v1.1.10,h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=,2c94771c1e335a2c58a96444b3768b8e00297747d6ce7e7c14bab2e8b39d91bd
+github.com/chzyer/readline,v0.0.0-20180603132655-2972be24d48e,h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=,3dc842677887278fb33d25078d375ae6a7a94bb77a8d205ee2230b581b6947a6
+github.com/chzyer/test,v0.0.0-20180213035817-a1ea475d72b1,h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=,ad8550bed3c4a94bbef57b9fc5bb15806eaceda00925716404320580d60e2f7d
+github.com/cihub/seelog,v0.0.0-20170130134532-f561c5e57575,h1:kHaBemcxl8o/pQ5VM1c8PVE1PubbNx3mjUr09OqWGCs=,fc279208e6094fb22c8ea651c6e9794844069693c9b916c225276c54f7e76bfe
+github.com/circonus-labs/circonus-gometrics,v2.3.1+incompatible,h1:C29Ae4G5GtYyYMm1aztcyj/J5ckgJm2zwdDajFbx1NY=,d8081141497e3cd34844df66af016c7900d58b324fb689e17e57bc053d91c9ba
+github.com/circonus-labs/circonusllhist,v0.1.3,h1:TJH+oke8D16535+jHExHj4nQvzlZrj7ug5D7I/orNUA=,4dc805d9735dd9ca9b8875c0ad23126abb5bc969c5a40c61b5bc891808dbdcb6
+github.com/clbanning/mxj,v1.8.4,h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I=,8947cf617bdd9efc62817c8ddb17bafe497f35abdf10a3c60f295e387f633f70
+github.com/client9/misspell,v0.3.4,h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=,a3af206372e131dd10a68ac470c66a1b18eaf51c6afacb55b2e2a06e39b90728
+github.com/cloudflare/backoff,v0.0.0-20161212185259-647f3cdfc87a,h1:8d1CEOF1xldesKds5tRG3tExBsMOgWYownMHNCsev54=,2aea6d1528c42cf5f111e035bba564fd0481cb4ddb3b50f783f2481d855947cb
+github.com/cloudflare/cfssl,v1.4.0,h1:TdyQbj/bDUMUHf2IkcHU2EHUmzCmRLuJ3fFd8EYMg1E=,845fc5f4a7f4c2356d676916fdd7b4b2217b76c8f9b7a960290ab8884d6f8e0e
+github.com/cloudflare/cloudflare-go,v0.10.4,h1:7C1D9mtcNFZLCqmhkHK2BlwKKm9fi4cBqY6qpYtQv5E=,e8f6ee817c9b807c98559ff87d4ed7a284738d9dc253b6db7520911d93bd81e3
+github.com/cloudflare/go-metrics,v0.0.0-20151117154305-6a9aea36fb41,h1:/8sZyuGTAU2+fYv0Sz9lBcipqX0b7i4eUl8pSStk/4g=,9176a680ad7a72cf717e3e01ee1ca6b292cb576b543e12ff1770cc58957bc222
+github.com/cloudflare/golz4,v0.0.0-20150217214814-ef862a3cdc58,h1:F1EaeKL/ta07PY/k9Os/UFtwERei2/XzGemhpGnBKNg=,75832d1c2989b2a0d7eb8d2cec300f6d457254d42927a23f522b164833e791d4
+github.com/cloudflare/redoctober,v0.0.0-20171127175943-746a508df14c,h1:p0Q1GvgWtVf46XpMMibupKiE7aQxPYUIb+/jLTTK2kM=,e69334393aec994f9ba55bbdfa8a65c0cfa46080230068c44ca16a85c0a74079
+github.com/cloudfoundry-community/go-cfclient,v0.0.0-20190201205600-f136f9222381,h1:rdRS5BT13Iae9ssvcslol66gfOOXjaLYwqerEn/cl9s=,f01d41c3c911b59bf717674690799c978f3a841ef695c7ee09f4afe5f7c96e64
+github.com/cloudfoundry-incubator/candiedyaml,v0.0.0-20170901234223-a41693b7b7af,h1:6Cpkahw28+gcBdnXQL7LcMTX488+6jl6hfoTMRT6Hm4=,325af9d6827b8d120a72992c38ba776187fbd947a39c9f1928a43a1a2b262453
+github.com/cloudfoundry/bosh-agent,v2.271.0+incompatible,h1:277mM9hsUzyrd5Qd/5e1LFwiobIYorE7vTBRZohRV8s=,42e253b855d03655ec2cf59ab01a14aa0037f25029517be595dda26ff9a2a552
+github.com/cloudfoundry/bosh-utils,v0.0.0-20191026100324-0b6803ec5382,h1:Rrpgz+K2Zso//XUmqbGlnYi9rw6EtYJ4uLlTNSnSBIw=,c08bbf97e510b2de271fd64f5b2acedfa011b4fd3f30092804992084c67b68b7
+github.com/cloudfoundry/gosigar,v1.1.0,h1:V/dVCzhKOdIU3WRB5inQU20s4yIgL9Dxx/Mhi0SF8eM=,53acb43e5111c6af6af138e1144907bb5f9bf8abc28e71a703502f92c13ba274
+github.com/cloudfoundry/sonde-go,v0.0.0-20171206171820-b33733203bb4,h1:cWfya7mo/zbnwYVio6eWGsFJHqYw4/k/uhwIJ1eqRPI=,6124fdcac54e1baf09703ed2b938a4e2bb55d9cd20f78451f25c16638a95f62d
+github.com/cockroachdb/apd,v1.1.0,h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=,fef7ec2fae220f84bfacb17fbfc1b04a666ab7f6fc04f3ff6d2b1e05c380777d
+github.com/cockroachdb/apd/v2,v2.0.1,h1:y1Rh3tEU89D+7Tgbw+lp52T6p/GJLpDmNvr10UWqLTE=,9f1c35b8118f70f08150bf5e9da225fa1201f5d0f8c22f326468ea22ab6b791d
+github.com/cockroachdb/cockroach-go,v0.0.0-20190916165215-ad57a61cc915,h1:QX2Zc22B15gdWwDCwS7BXmbeD/SWdcRK12gOfZ5BsIs=,e3faa1cdf2a15357d1e2eb200b3bdb81dae3fb084cb04534e0caf27a68487a88
+github.com/cockroachdb/datadriven,v0.0.0-20190809214429-80d97fb3cbaa,h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y=,170480bf3daa133144f2578e3f051f0fd98313666642cab64cef3359753a5c32
+github.com/codahale/hdrhistogram,v0.0.0-20161010025455-3a0bb77429bd,h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w=,e7e117da64da2f921b1f9dc57c524430a7f74a78c4b0bad718d85b08e8374e78
+github.com/codegangsta/inject,v0.0.0-20150114235600-33e0aa1cb7c0,h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q=,0a324d56992bffd288fa70a6d10eb9b8a9467665b0b1eb749ac6ae80e8977ee2
+github.com/codegangsta/negroni,v1.0.0,h1:+aYywywx4bnKXWvoWtRfJ91vC59NbEhEY03sZjQhbVY=,2e6301aa682a7c38305f2ee72b276181cd0990f224f9fe115a433a5beb138488
+github.com/codeskyblue/go-sh,v0.0.0-20190412065543-76bd3d59ff27,h1:HHUr4P/aKh4quafGxDT9LDasjGdlGkzLbfmmrlng3kA=,77348ab27860460a015d0e65d08f18ed2194c13981f5fd722143a6e0c2dbb589
+github.com/confluentinc/confluent-kafka-go,v1.1.0,h1:HIW7Nkm8IeKRotC34mGY06DwQMf9Mp9PZMyqDxid2wI=,bc9aee1c8052340809bc43bf015a183985ec3426d404c34acfa3970e3b245340
+github.com/container-storage-interface/spec,v1.2.0,h1:bD9KIVgaVKKkQ/UbVUY9kCaH/CJbhNxe0eeB4JeJV2s=,86ecb02d57af97c9a4de8f2f3cacbceb5c7f2f96ee007133e0cfb9525ce45177
+github.com/containerd/cgroups,v0.0.0-20191011165608-5fbad35c2a7e,h1:3bt+8T1I/CuYx+a5ww32+UT4fc9x8iRiXrhfduFTlBU=,4646f14f27a365ff08abb1266b7ca4dffc1acd5e8e74b57211acbba22b496d46
+github.com/containerd/console,v0.0.0-20181022165439-0650fd9eeb50,h1:WMpHmC6AxwWb9hMqhudkqG7A/p14KiMnl6d3r1iUMjU=,62a7f1da11b3be4c0ef4f9f03b99dcf59dc988f062749f35e4e6bb585fb4e4fe
+github.com/containerd/containerd,v1.3.0,h1:xjvXQWABwS2uiv3TWgQt5Uth60Gu86LTGZXMJkjc7rY=,e3f529147f2c909c85ac461126ad092a3c5d5a2abcc4f3c22600685af6dc2f08
+github.com/containerd/continuity,v0.0.0-20190827140505-75bee3e2ccb6,h1:NmTXa/uVnDyp0TY5MKi197+3HWcnYWfnHGyaFthlnGw=,ef1a3a4c2c1508d293eb2730e47e9601cba19d939393b1018d8e476b30dfd90b
+github.com/containerd/fifo,v0.0.0-20190816180239-bda0ff6ed73c,h1:KFbqHhDeaHM7IfFtXHfUHMDaUStpM2YwBR+iJCIOsKk=,0c1b858ee9dd28bd915a3f7bd108b98b1d689be3c14535e7e8aee4a60c4a72c0
+github.com/containerd/go-runc,v0.0.0-20190923131748-a2952bc25f51,h1:vmF3zULCGpZ4QJCCLsGUXX7tNXW+0x3r9owerRAmRaU=,76ce6296dc07f1f5957867e9a5925cf9e16c69ad2b635f74a4ec471e6672ee51
+github.com/containerd/ttrpc,v0.0.0-20191028202541-4f1b8fe65a5c,h1:+RqLdWzn0xFunb+sxXaEzHOg8NuEG/eaI+9C1xXX8Mw=,f43884f8f37259c4b50a4413092064f35abd03b9db3bbe2ca3264b5a4b591b04
+github.com/containerd/typeurl,v0.0.0-20190911142611-5eb25027c9fd,h1:bRLyitWw3PT/2YuVaCKTPg0cA5dOFKFwKtkfcP2dLsA=,aa4e0823acf7b686a9521617134a171c5b5813de302e3fba742cd3b7f43ba944
+github.com/containernetworking/cni,v0.7.1,h1:fE3r16wpSEyaqY4Z4oFrLMmIGfBYIKpPrHK31EJ9FzE=,b83f1b8e9bba747e41512737383da57e517cf425beb1bd58882904dae9348b1d
+github.com/containers/image,v3.0.2+incompatible,h1:B1lqAE8MUPCrsBLE86J0gnXleeRq8zJnQryhiiGQNyE=,dadc25bfff923d4f2c8b570471be3b0fd1449f42251fb6c318b68e04f6d47b3a
+github.com/containers/storage,v1.12.13,h1:GtaLCY8p1Drlk1Oew581jGvB137UaO+kpz0HII67T0A=,08f5ee958be629b73ff02296eb11f4b0698dbd90e585ce019c5428a8e1d371d4
+github.com/containous/flaeg,v1.4.1,h1:VTouP7EF2JeowNvknpP3fJAJLUDsQ1lDHq/QQTQc1xc=,d097191570bb92f920cd15500a93205e6e93b5ee4723a51c9b8e3bfbcfaae505
+github.com/corbym/gocrest,v1.0.3,h1:gwEdq6RkTmq+09CTuM29DfKOCtZ7G7bcyxs3IZ6EVdU=,f13221d177442318b04f468fa57ea92bd9892d86e7cf7bb7299e0c58cea9df48
+github.com/coredns/coredns,v1.1.2,h1:bAFHrSsBeTeRG5W3Nf2su3lUGw7Npw2UKeCJm/3A638=,cbf720a9af4fdc5be08b0eea67fe219bb08c75292e22dca90095bf45cbd4a926
+github.com/coreos/bbolt,v1.3.3,h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY=,63ea574f28bd03b6d2a82304e0f7c96dcb30fa048311a4c8c3ad512dbacc4630
+github.com/coreos/clair,v0.0.0-20180919182544-44ae4bc9590a,h1:glxUtT0RlaVJU86kg78ygzfhwW6D+uj5H+aOK01QDgI=,3bc8c4b06a61c5673fcc69d5278b3a5313633fca1166e94a7140c363399c3dc6
+github.com/coreos/etcd,v3.3.17+incompatible,h1:f/Z3EoDSx1yjaIjLQGo1diYUlQYSBrrAQ5vP8NjwXwo=,d7ca8db509166ce05482c9b3e80cfb8d1086691901e80202f571d152da912153
+github.com/coreos/go-etcd,v2.0.0+incompatible,h1:bXhRBIXoTm9BYHS3gE0TtQuyNZyeEMux2sDi4oo5YOo=,4b226732835b9298af65db5d075024a5971aa11ef4b456899a3830bccd435b07
+github.com/coreos/go-iptables,v0.4.3,h1:jJg1aFuhCqWbgBl1VTqgTHG5faPM60A5JDMjQ2HYv+A=,4626df8f719f93e5d66bd995d586ae3540c24b2203c0d2aab7c6d5e60f89a3dc
+github.com/coreos/go-oidc,v2.1.0+incompatible,h1:sdJrfw8akMnCuUlaZU3tE/uYXFgfqom8DBE9so9EBsM=,e2e123270614dd7d47d95ae1fce80a9102df019f9e820d4f5cf5c92c64e1ad91
+github.com/coreos/go-semver,v0.3.0,h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=,b2fc075395ffc34cff4b964681d0ae3cd22096cfcadd2970eeaa877596ceb210
+github.com/coreos/go-systemd,v0.0.0-20190719114852-fd7a80b32e1f,h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c=,22237f0aed3ab6018a1025c65f4f45b4c05f9aa0c0bb9ec880294273b9a15bf2
+github.com/coreos/pkg,v0.0.0-20180928190104-399ea9e2e55f,h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=,7fe161d49439a9b4136c932233cb4b803b9e3ac7ee46f39ce247defc4f4ea8d7
+github.com/coreos/rkt,v1.30.0,h1:Kkt6sYeEGKxA3Y7SCrY+nHoXkWed6Jr2BBY42GqMymM=,436e294b735bada49407ad3c066ae251ef105ce59076ef8f0f732c586a72970e
+github.com/cosiner/argv,v0.0.0-20170225145430-13bacc38a0a5,h1:rIXlvz2IWiupMFlC45cZCXZFvKX/ExBcSLrDy2G0Lp8=,deb11c1c7a2fa44b3497731d497b3d7be5a51cf696ed43280e01822e2eed9b96
+github.com/cosmos/cosmos-sdk,v0.35.0,h1:EPeie1aKHwnXtTzKggvabG7aAPN+DDmju2xquvjFwao=,ccc975b48e3b40f4eb054e28e9243ecb48c0d8ecdf52b9512da26a8200cc7c43
+github.com/cosmos/go-bip39,v0.0.0-20180819234021-555e2067c45d,h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU=,e41d7ea781b15421a4690bedf78543f2eaad00c36c439dd4973131dec1985177
+github.com/cosmos/ledger-cosmos-go,v0.10.3,h1:Qhi5yTR5Pg1CaTpd00pxlGwNl4sFRdtK1J96OTjeFFc=,f1089701d8868e4ff3fd9e9a4104476963f725a713ee2a476b4ef8094a0bca20
+github.com/cosmos/ledger-go,v0.9.2,h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI=,a77b2063a64133d8dda638d5d602071429d7e2500576bfff5c1763f8572a8517
+github.com/couchbase/go-couchbase,v0.0.0-20191031153726-96c2e23d589a,h1:eKnoG+AQQQIxHEcBIbudmwLJv3S9UQU6oGHzvqhttqE=,5dd3e610f24adb44b31e7ecc6a80a8974b769bd622d569c69fb98bd02610bbef
+github.com/couchbase/gomemcached,v0.0.0-20191004160342-7b5da2ec40b2,h1:vZryARwW4PSFXd9arwegEywvMTvPuXL3/oa+4L5NTe8=,5b9a280cd2d546cd0d70fbd6828e73fa0b07fb9d3c0b6bff88d8e23d8e4256f4
+github.com/couchbase/goutils,v0.0.0-20190315194238-f9d42b11473b,h1:bZ9rKU2/V8sY+NulSfxDOnXTWcs1rySqdF1sVepihvo=,a2820e0f01d8c944b70c70515b9924f41b450f3688d19ad4d506b2b9b367c433
+github.com/couchbase/vellum,v0.0.0-20190111184608-e91b68ff3efe,h1:2o6Y7KMjJNsuMTF8f2H2eTKRhqH7+bQbjr+D+LnhE5M=,06e3ca28a98c95bcdfd909168e1dcf45a6667ef59ad59112a01e6bbdcf591e84
+github.com/couchbaselabs/go-couchbase,v0.0.0-20190708161019-23e7ca2ce2b7,h1:1XjEY/gnjQ+AfXef2U6dxCquhiRzkEpxZuWqs+QxTL8=,3429eb55dd38b07bab5e9a57a3e2451449b49bdbc6f16585f8b7557067572499
+github.com/cpu/goacmedns,v0.0.1,h1:GeIU5chKys9zmHgOAgP+bstRaLqcGQ6HJh/hLw9hrus=,12acca48bb444f3832a87b8d238e573bbfa60e5c25dfcf6787a003dfacaf055d
+github.com/cpuguy83/go-md2man,v1.0.10,h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=,b9b153bb97e2a702ec5c41f6815985d4295524cdf4f2a9e5633f98e9739f4d6e
+github.com/cpuguy83/go-md2man/v2,v2.0.0,h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=,f2fdd06287a80f1bea5552f572d7f2314ec829285a3040b63469e0635f66fb6d
+github.com/creack/goselect,v0.1.0,h1:4QiXIhcpSQF50XGaBsFzesjwX/1qOY5bOveQPmN9CXY=,24d8028970032b1a45091ad8ff9b9c280693def1433cb5948ed92c0c975226ea
+github.com/creack/pty,v1.1.7,h1:6pwm8kMQKCmgUg0ZHTm5+/YvRK0s3THD/28+T6/kk4A=,e7ea3403784d186aefbe84caed958f8cba2e72a04f30cdb291ece19bec39c8f3
+github.com/cskr/pubsub,v1.0.2,h1:vlOzMhl6PFn60gRlTQQsIfVwaPB/B/8MziK8FhEPt/0=,39e40a42c10058c188f331ed0bb660a0504d7c2ddd9e835a9970786fdc35feb0
+github.com/cupcake/rdb,v0.0.0-20161107195141-43ba34106c76,h1:Lgdd/Qp96Qj8jqLpq2cI1I1X7BJnu06efS+XkhRoLUQ=,019a246ac0d7f6fcf3758587a031767730cfb824003c311686a4eb552a1dcc57
+github.com/cweill/gotests,v1.5.3,h1:k3t4wW/x/YNixWZJhUIn+mivmK5iV1tJVOwVYkx0UcU=,7ced96d4223a0afcd41922c4d3ae064493dd5bedbc72f6541716fce1cab24b7d
+github.com/cxr29/aliyun-openapi-go-sdk,v0.0.0-20151123082822-0b043e4d1e0c,h1:WEWetvNRZlk7JW3M4fycSA3f/2xZGxRdrwmpgRkGoQc=,6c80128745e3acdd01f59bc6c6e3a1f24193e89eb627ad6dcc615e763878b6e4
+github.com/cyphar/filepath-securejoin,v0.2.2,h1:jCwT2GTP+PY5nBz3c/YL5PAIbusElVrPujOBSCj8xRg=,d022873dbb9e8d3b7a43c9dedbea54dfc9a6c15f9632ba522a1257e8b948c100
+github.com/cznic/b,v0.0.0-20181122101859-a26611c4d92d,h1:SwD98825d6bdB+pEuTxWOXiSjBrHdOl/UVp75eI7JT8=,1c34b27ce98f70cb0e97c2bbe0bdae216cc1ea6b2617b0e984e2ce30adc06338
+github.com/cznic/fileutil,v0.0.0-20181122101858-4d67cfea8c87,h1:94XgeeTZ+3Xi9zsdgBjP1Byx/wywCImjF8FzQ7OaKdU=,109b4c91722a0f9a4f941d77eff34270684e53ca36e7d14ab2cd4a4e80841d73
+github.com/cznic/golex,v0.0.0-20181122101858-9c343928389c,h1:G8zTsaqyVfIHpgMFcGgdbhHSFhlNc77rAKkhVbQ9kQg=,d2b11a6e0e1de5125a2d550650b4cbb7bf44280ebf1cda74ef4a63e3cfa11012
+github.com/cznic/internal,v0.0.0-20181122101858-3279554c546e,h1:58AcyflCe84EONph4gkyo3eDOEQcW5HIPfQBrD76W68=,bc177d001529bca3f46aa84855db4e783a041c188d3ba237f68fa4522bdca74b
+github.com/cznic/kv,v0.0.0-20181122101858-e9cdcade440e,h1:8ji4rZgRKWMQUJlPNEzfzCkX7yFAZFR829Mrh7PXxLA=,4f992bdaf6d17487c7b16669b6d55afa76b321e63f8e4b6a6d1126b44b18b0d9
+github.com/cznic/lldb,v1.1.0,h1:AIA+ham6TSJ+XkMe8imQ/g8KPzMUVWAwqUQQdtuMsHs=,ddec7228568547a5fbfbc6a91208cbcafeed4338a38c41d483448957e4bec186
+github.com/cznic/mathutil,v0.0.0-20181122101859-297441e03548,h1:iwZdTE0PVqJCos1vaoKsclOGD3ADKpshg3SRtYBbwso=,8f69a36f60d885e011b0a90b91246a7e88223cb2883dc6e71eab3f42d653231b
+github.com/cznic/parser,v0.0.0-20181122101858-d773202d5b1f,h1:DUtr2TvhM9rmiHKVJWoLqDY2+MdxljW9hlaS/oYoi1c=,18b746a4090720bd9dfe219d0f7bb7fb28565df70417208d7e99dfd79f1ea264
+github.com/cznic/ql,v1.2.0,h1:lcKp95ZtdF0XkWhGnVIXGF8dVD2X+ClS08tglKtf+ak=,05164e379d43eaada0efdd763a50a9ef8f4b7f73a5de7ab866093bb25a4fb747
+github.com/cznic/sortutil,v0.0.0-20181122101858-f5f958428db8,h1:LpMLYGyy67BoAFGda1NeOBQwqlv7nUXpm+rIVHGxZZ4=,67783879c1ae4472fdabb377b1772e4e4c5ced181528c2fc4569b565cb47a57b
+github.com/cznic/strutil,v0.0.0-20181122101858-275e90344537,h1:MZRmHqDBd0vxNwenEbKSQqRVT24d3C05ft8kduSwlqM=,867902276444cbffca84d9d5f63754e8b22092d93a94480d8dfebd234ac8ffbd
+github.com/cznic/y,v0.0.0-20181122101901-b05e8c2e8d7b,h1:gvFsf4zJcnW6GRN+HPGTxwuw+7sTwzmoeoBQQCZDEnk=,8c84f5e4f9dc5f0809d8ad22d057e404c3e8644dc28e8fc52abbb1d2350f8d3e
+github.com/cznic/zappy,v0.0.0-20181122101859-ca47d358d4b1,h1:ytLS5Cgkxq6jObotJ+a13nsejdqzLFPliDf8CQ8OkAA=,505c19b52924ee21b65611bc45640d3ff4671e50ee04f7c17c38342190645595
+github.com/d2g/dhcp4,v0.0.0-20170904100407-a1d1b6c41b1c,h1:Xo2rK1pzOm0jO6abTPIQwbAmqBIOj132otexc1mmzFc=,15df9468cf548a626e1319e92d550432512c4319cf555bf278ea9215de3504e3
+github.com/daaku/go.zipexe,v1.0.0,h1:VSOgZtH418pH9L16hC/JrgSNJbbAL26pj7lmD1+CGdY=,74d7a0242c03c3c03220e56a59da5f97d3478743250740df538e05e6b609f553
+github.com/danwakefield/fnmatch,v0.0.0-20160403171240-cbb64ac3d964,h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ=,f601e8d25a43ed32e00851e1686a93b0175dadea8f4e32c8af2f1533f20736bc
+github.com/dave/jennifer,v1.2.0,h1:S15ZkFMRoJ36mGAQgWL1tnr0NQJh9rZ8qatseX/VbBc=,85b37a1b99b7d67664389b8c11b7174f521a396bb59d4e0e766df16336a7f112
+github.com/dave/services,v0.1.0,h1:7isGzpZHJWmOYTV+Pn3f6gpQUmrveJqsQpAkH0HXFbU=,e52a7ffba3aa07cca4888e08248771211abd139928b5cde9b228a61da88eddcc
+github.com/davecgh/go-spew,v1.1.1,h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=,6b44a843951f371b7010c754ecc3cabefe815d5ced1c5b9409fb2d697e8a890d
+github.com/davecgh/go-xdr,v0.0.0-20161123171359-e6a2ba005892,h1:qg9VbHo1TlL0KDM0vYvBG9EY0X0Yku5WYIPoFWt8f6o=,11cb87912b5288e13534cb396935694c257eb9164ffc20ce21e3bc9955edd82a
+github.com/daviddengcn/go-colortext,v0.0.0-20180409174941-186a3d44e920,h1:d/cVoZOrJPJHKH1NdeUjyVAWKp4OpOT+Q+6T1sH7jeU=,159d727adf4f0763ec3dc6156fd46531a2afbffdc17feeb6b5ffe2eb54b35d41
+github.com/davyxu/cellnet,v4.1.0+incompatible,h1:zDRqhkFRhBTD7ajra2888aoRLN1qlv8LV8+qHg/emO4=,f085f088b68b2e379a6dc37501ef2c9809836cfac147a30ed3025571c2d57df7
+github.com/davyxu/golog,v0.1.0,h1:SsV3m2x37sCzFaQzq5OHc5S+PE2VMiL7XUx34JCa7mo=,a3c240bc4b958fa4b4e73caa59c28fc658afbabdb1f28b237874803ca96dcb1f
+github.com/dchest/blake256,v1.0.0,h1:6gUgI5MHdz9g0TdrgKqXsoDX+Zjxmm1Sc6OsoGru50I=,9a9ed00a3024f2f7480b59c7b2ee1013cae3026d7dc2f065ce225dcce8cf357e
+github.com/dchest/siphash,v1.2.1,h1:4cLinnzVJDKxTCl9B01807Yiy+W7ZzVHj/KIroQRvT4=,877a468e533e28c777c59b3dfea175b38a1f0bc1f8551e3a9e1739b1821c7e3e
+github.com/dchest/uniuri,v0.0.0-20160212164326-8902c56451e9,h1:74lLNRzvsdIlkTgfDSMuaPjBr4cf6k7pwQQANm/yLKU=,41db9fb52a841d11d8592a1d4f56e8a440e3991b699ae0f95ab5f5a7b2aeb24c
+github.com/deckarep/golang-set,v1.7.1,h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ=,86606609df42529fda55a15475b495f993f0c1cc4be6e1e50a9165a514d1ed71
+github.com/decker502/dnspod-go,v0.2.0,h1:6dwhUFCYbC5bgpebLKn7PrI43e/5mn9tpUL9YcYCdTU=,381fb0bb29ac973f318db3d464f76e5d3016d4963c78ccd7df7dbc4231a68455
+github.com/decred/base58,v1.0.0,h1:BVi1FQCThIjZ0ehG+I99NJ51o0xcc9A/fDKhmJxY6+w=,75b1a2c78759ee2e8755156806ce770c9199464c2d58541388d5ec7c000c99e1
+github.com/decred/dcrd/chaincfg,v1.5.1,h1:u1Xbq0VTnAXIHW5ECqrWe0VYSgf5vWHqpSiwoLBzxAQ=,7344cd4dc90a82342c90811c8180b1fef6c79e9c49caa38135f271cf0ecb056f
+github.com/decred/dcrd/chaincfg/chainhash,v1.0.2,h1:rt5Vlq/jM3ZawwiacWjPa+smINyLRN07EO0cNBV6DGU=,a8b24e2c4e64015430b8a6502f9e8c3eeea246021638884dc510508eccda31a0
+github.com/decred/dcrd/chaincfg/v2,v2.0.2,h1:VeGY52lHuYT01tIGbvYj+OO0GaGxGaJmnh+4vGca1+U=,906dec975cf574c55f2eb588dc91a4ddd6be273eaddfbeb45288ea6aebcc6306
+github.com/decred/dcrd/crypto/blake256,v1.0.0,h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=,cd8bbdae14641f0ba44430fc66990dd37bbfcf1e21a965a9fd1871d16cac127d
+github.com/decred/dcrd/dcrec,v1.0.0,h1:W+z6Es+Rai3MXYVoPAxYr5U1DGis0Co33scJ6uH2J6o=,a1e16c5ef3633f2dfa23c052778552cf9300821197f5b2dc547e20dd9d45756b
+github.com/decred/dcrd/dcrec/edwards,v1.0.0,h1:UDcPNzclKiJlWqV3x1Fl8xMCJrolo4PB4X9t8LwKDWU=,7ed52f3316f5a47c5925e23bebf5016ecfd75e7ac340714b4b94b0e25bdf0611
+github.com/decred/dcrd/dcrec/secp256k1,v1.0.2,h1:awk7sYJ4pGWmtkiGHFfctztJjHMKGLV8jctGQhAbKe0=,5fa2c17fd611665a39e6435283445ec3b46a5b52d14661e04bd1f7ef295ba9d3
+github.com/decred/dcrd/dcrutil,v1.4.0,h1:xD5aUqysGQnsnP1c9J0kGeW8lDIwFGC3ja/gE3HnpCs=,6de50428375fca174f4861f8aa45549360e7733bca0184a882448f0b9f94be2e
+github.com/decred/dcrd/dcrutil/v2,v2.0.0,h1:HTqn2tZ8eqBF4y3hJwjyKBmJt16y7/HjzpE82E/crhY=,fa91eb7c5062e0f3f6e7d1b9d8e1a89698f6ee6e7f8f4941929f6d89a293ec76
+github.com/decred/dcrd/wire,v1.3.0,h1:X76I2/a8esUmxXmFpJpAvXEi014IA4twgwcOBeIS8lE=,e17b78d19d0056503627826a0e599ed14a7a4fc8aa2c31c47b12ffc1864aedb1
+github.com/decred/slog,v1.0.0,h1:Dl+W8O6/JH6n2xIFN2p3DNjCmjYwvrXsjlSJTQQ4MhE=,1c27399a3f38fb7b581f4dbe11a0b3e3d5d8afcc8109880771c0e44135388bb0
+github.com/denisenkom/go-mssqldb,v0.0.0-20191001013358-cfbb681360f0,h1:epsH3lb7KVbXHYk7LYGN5EiE0MxcevHU85CKITJ0wUY=,ff2349c73cee9e54cd61e85af75d7d0537fb5f070da5a737b5abede1f7d579ac
+github.com/denkhaus/bitshares,v0.6.1-0.20190502142618-5ae8c00cb394,h1:PpFS6pvAoRwH13WlqnX/mrxesu6LNFtiVwoWgfNLCeY=,af76695d3e546cad6a8b56d9d5e431bfeb12bfce643a395fb45d8827409dd9ff
+github.com/denkhaus/gojson,v1.0.0,h1:p1hAlN/yAvRvzbdO1HNDQvmBslfyk64IMt3O3DtftPU=,5c0d8d98a53be88e2801d90124e28ba781d2c6a09aaf9a57272df92c5c0e0fe2
+github.com/denkhaus/logging,v0.0.0-20180714213349-14bfb935047c,h1:imM7UU8JD1sNuk2tVEk3QvrY2RZ5f/DOB+UA7c5ThGs=,5a1bb81f35dc7847b0cb8efe3f1e3bac3a34c9f11950a7c7643115c952fa3166
+github.com/denverdino/aliyungo,v0.0.0-20170926055100-d3308649c661,h1:lrWnAyy/F72MbxIxFUzKmcMCdt9Oi8RzpAxzTNQHD7o=,e6ca432bab5a7b1d233c9c1495d32668d31b18803d65f3af27f1d8240b6547d4
+github.com/detached/gorocket,v0.0.0-20170629192631-d44bbd3f26d2,h1:zwp9mAr+YvsgLCFIVJ3/m61Z+NRX35jbD0HBa62ryHY=,f54c9dc20ba925f0b2a726cc1a22466c6e05d7e0080f6e4b5f26e60c15938712
+github.com/detailyang/go-fallocate,v0.0.0-20180908115635-432fa640bd2e,h1:lj77EKYUpYXTd8CD/+QMIf8b6OIOTsfEBSXiAzuEHTU=,dcc45102d034d78825d1aa9d2f61720b4b0d9f76314a7a53b32cf032713a0bde
+github.com/devfeel/dotweb,v1.7.3,h1:tt7YtCIp9JPmAS2yksVIsw6CiUkUSz3kVLSiCzRaWDw=,7cdb6d4872bb4c82fc333722fb2be3e39fe391b121550421d240d3008c8e00a0
+github.com/devigned/tab,v0.1.1,h1:3mD6Kb1mUOYeLpJvTVSDwSg5ZsfSxfvxGRTxRsJsITA=,528e21b578f28a998453551c51abfdeed154c981486d49a8ad7c149743ea450f
+github.com/dghubble/oauth1,v0.6.0,h1:m1yC01Ohc/eF38jwZ8JUjL1a+XHHXtGQgK+MxQbmSx0=,6d4be6cfc2771fab15e47d2aa9c40d347dab7166f2cae3c248aeb51b10c88b4a
+github.com/dghubble/sling,v1.3.0,h1:pZHjCJq4zJvc6qVQ5wN1jo5oNZlNE0+8T/h0XeXBUKU=,880e7f44ee68eae979a34afb2f95ab1c7555712153c45be01d15cbc5991a5fe6
+github.com/dgraph-io/badger,v1.6.0,h1:DshxFxZWXUcO0xX476VJC07Xsr6ZCBVRHKZ93Oh7Evo=,8329ae390aebec6ae360356e77a2743357ad4e0d0bd4c3ae03b7d17e01ad70aa
+github.com/dgraph-io/dgo,v1.0.0,h1:DRuI66G+j0XWDOXly4v5PSk2dGkbIopAZIirRjq7lzI=,dae0ee7690b0c58d72be328263d55394f88a4924a8274017021736d702be9cee
+github.com/dgrijalva/jwt-go,v3.2.0+incompatible,h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=,26b028eb2d9ee3aef26a96d6790e101f4088ef901008ebab17096966bf6522ad
+github.com/dgryski/go-farm,v0.0.0-20190423205320-6a90982ecee2,h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=,d1fb60f1ce562acb07569d53b43353b73f439911c27eecef716305cd2d730258
+github.com/dgryski/go-jump,v0.0.0-20170409065014-e1f439676b57,h1:qZNIK8jjHgLFHAW2wzCWPEv0ZIgcBhU7X3oDt/p3Sv0=,92666f8caf4843c5a9b6bdb0f48f261922595683351958b0909884adf064cfb2
+github.com/dgryski/go-metro,v0.0.0-20180109044635-280f6062b5bc,h1:8WFBn63wegobsYAX0YjD+8suexZDga5CctH4CCTx2+8=,3f97b3cdeaee7b4fbf4fa06b7c52e3ee6bca461a100077892e861c6c8fc03722
+github.com/dgryski/go-sip13,v0.0.0-20190329191031-25c5027a8c7b,h1:Yqiad0+sloMPdd/0Fg22actpFx0dekpzt1xJmVNVkU0=,81d318bf94b85b240278c35d7ef6015510751e31ffa89eb6287d6d236493551e
+github.com/digitalocean/go-libvirt,v0.0.0-20190626172931-4d226dd6c437,h1:phR13shVFOIpa1pnLBmewI9p16NEladLPvVylLPeexo=,7748e819d19524170969d2a470c212bb3936778ff630f833adc286e8c21e37cc
+github.com/digitalocean/go-qemu,v0.0.0-20181112162955-dd7bb9c771b8,h1:N7nH2py78LcMqYY3rZjjrsX6N7uCN7sjvaosgpXN9Ow=,7530507881e53214ed3c0fb770fb3faed36a57ca6eb376bd2cec91a0e5d575a6
+github.com/digitalocean/godo,v1.11.1,h1:OsTh37YFKk+g6DnAOrkXJ9oDArTkRx5UTkBJ2EWAO38=,5d1ad5b25ad252fb1a02366087fe6e94845ec2dce64dc6e875ed3253a7e0f8ff
+github.com/dimchansky/utfbom,v1.1.0,h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4=,27fed73a62fcf06d4ceb28846e5d40786b7e81213aa0d1f4d840e89d25f285f7
+github.com/dimfeld/httppath,v0.0.0-20170720192232-ee938bf73598,h1:MGKhKyiYrvMDZsmLR/+RGffQSXwEkXgfLSA08qDn9AI=,ff59ff07643eccf8a166cc9693fbd18c42869e0bfcc0a9c979435847a7ae4fb1
+github.com/dimfeld/httptreemux,v5.0.1+incompatible,h1:Qj3gVcDNoOthBAqftuD596rm4wg/adLLz5xh5CmpiCA=,031da29a128234db595fdce84301cfe5ff13b4be03c1e344cfe7daadb68559e9
+github.com/disintegration/gift,v1.2.1,h1:Y005a1X4Z7Uc+0gLpSAsKhWi4qLtsdEcMIbbdvdZ6pc=,d9a688a552dc8f5b2319325541e2bbc5c0af66b6e78273058893b259fcca5a0f
+github.com/disintegration/imaging,v1.6.1,h1:JnBbK6ECIZb1NsWIikP9pd8gIlTIRx7fuDNpU9fsxOE=,209474c4c0348672c6747a7a73ff887a6d9458b67df78ff342ee3fd628156412
+github.com/djherbis/atime,v1.0.0,h1:ySLvBAM0EvOGaX7TI4dAM5lWj+RdJUCKtGSEHN8SGBg=,fe677e5c1a8bb168904c0856010bed33a770d49eda9edc6dc1b567940bf20afc
+github.com/dlclark/regexp2,v1.2.0,h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk=,61054c243455e034d7a81e2f6a888cab5a81056a0cc43463cb3536b42cfe7cc1
+github.com/dmotylev/goproperties,v0.0.0-20140630191356-7cbffbaada47,h1:sP2APvSdZpfBiousrppBZNOvu+TE79Myq4kkmmrtSuI=,8afdf7b2989dff361cc80e560c1bd17e5c4ad37826b5caf4b65af8e152cdc6cb
+github.com/dnaeon/go-vcr,v1.0.1,h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY=,8f586f95ce5567ef2ae702cf98e56a09ea0cc6171f5cd959e6fcf7502e00dabc
+github.com/dnsimple/dnsimple-go,v0.30.0,h1:IBIrn9jMKRMwporIRwdFyKdnHXVmwy6obnguB+ZMDIY=,5821d521b402f93dc19f6eb332d5f4159800336f53626c6dedd99ce4c351a55a
+github.com/dnstap/golang-dnstap,v0.1.0,h1:hKtRrSTEHuTmG0vCLgKU8WJkXCARoAJMDrlXHTTPBK8=,fe23fd626917c7f45ead63cef4a4bd1bb366bb30ba5873d9ee5432e79b971349
+github.com/docker/cli,v0.0.0-20191031185610-968ce1ae4d45,h1:KJ4FsevlLR30Q2H1aCACmL3CEoUTAZf16PMAJj+ofXI=,145fef54aa162edc123d514ed7a20bc14564581ad95bb6aae7294c3c08df55fd
+github.com/docker/distribution,v2.7.1+incompatible,h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug=,be78bc43d74873b67afe05a6b244490088680dab75bdfaf26d0fd4d054595bc7
+github.com/docker/docker,v1.13.1,h1:IkZjBSIc8hBjLpqeAbeE5mca5mNgeatLHBy3GO78BWo=,1decea9f21d4165bc134de72c51055612ff6992409cd56f3c35b7f78f3b542bd
+github.com/docker/docker-ce,v0.0.0-20180924210327-f53bd8bb8e43,h1:gZ4lWixV821UVbYtr+oz1ZPCHkbtE+ivfmHyZRgyl2Y=,d670d1c5faec51ee82dbc5d479a7fca60916c1b30547994c206622ab338a735a
+github.com/docker/docker-credential-helpers,v0.6.3,h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ=,4dd2971b28524442b7a01e118a8040c3ab90eca50d55a7a232af514d18187324
+github.com/docker/engine-api,v0.4.0,h1:D0Osr6+45yAlQqLyoczv5qJtAu+P0HB0rLCddck03wY=,0db5d01c8401192b4eee6d2f9c34aa297d1a892f25230b470efd73f8f7ab59a4
+github.com/docker/go,v1.5.1-1,h1:hr4w35acWBPhGBXlzPoHpmZ/ygPjnmFVxGxxGnMyP7k=,fd626ee84b1eaea11c2a374fda5ed5ca8ad820bb4746ee31519efeb5038077b5
+github.com/docker/go-connections,v0.4.0,h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=,570ebcee7e6fd844e00c89eeab2b1922081d6969df76078dfe4ffacd3db56ada
+github.com/docker/go-events,v0.0.0-20190806004212-e31b211e4f1c,h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8=,0f654eb0e7e07c237a229935ea3488728ddb5b082af2918b64452a1129dccae3
+github.com/docker/go-metrics,v0.0.1,h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=,4efab3706215f5b2d29ba823d3991fd6e2f81c02ce45ef0c73c019ebc90e020b
+github.com/docker/go-units,v0.4.0,h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=,0f2be7dce7b1a0ba6a4a786eb144a3398e9a61afc0eec5799a1520d9906fc58c
+github.com/docker/libkv,v0.2.1,h1:PNXYaftMVCFS5CmnDtDWTg3wbBO61Q/cEo3KX1oKxto=,7a0c81782d38b550acc2c0ef0ce397adfc13716f483be6a47d0b97fbc6eea0d5
+github.com/docker/libnetwork,v0.5.6,h1:hnGiypBsZR6PW1I8lqaBHh06U6LCJbI3IhOvfsZiymY=,7aea42c405304c495bf159e5004674eb503eb0120eb4c5d1275fdba65d88cc53
+github.com/docker/libtrust,v0.0.0-20160708172513-aabc10ec26b7,h1:UhxFibDNY/bfvqU5CAUmr9zpesgbU6SWc8/B4mflAE4=,bf1c1230a3b5c0dadb2c9366aabc99181e708369d735dc83c3eb89f597f42adb
+github.com/docker/machine,v0.16.2,h1:jyF9k3Zg+oIGxxSdYKPScyj3HqFZ6FjgA/3sblcASiU=,1c13210831cafddba1abbf9ef034135233252c62927df396fee6fa0a45efcb43
+github.com/docker/notary,v0.6.1,h1:6BO5SNujR+CIuj2jwT2/yD6LdD+N9f5VbzR+nfzB5ZA=,439fd6664fb75323d78c5a362483f3375a6ac61a3dd08438a503df470a34f300
+github.com/docker/spdystream,v0.0.0-20160310174837-449fdfce4d96,h1:cenwrSVm+Z7QLSV/BsnenAOcDXdX4cMv4wP0B/5QbPg=,70964f9eef29843634539b8d6e09c8b51ed6aa96b5deda28b7a44613327a22f2
+github.com/docker/swarmkit,v1.12.0,h1:vcbNXevt9xOod0miQxkp9WZ70IsOCe8geXkmFnXP2e0=,b9d09ff080beb0db2d4d4ebca93438dd080769266eb7aab6d5182e1ad7ba2c3a
+github.com/docopt/docopt-go,v0.0.0-20180111231733-ee0de3bc6815,h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=,00aad861d150c62598ca4fb01cfbe15c2eefb5186df7e5d4a59286dcf09556c8
+github.com/documize/community,v3.2.0+incompatible,h1:ilePrhqxjc+BWpDRsXPyLyMEE1BrGlqCPMg3T577mzQ=,e9e06bdbef4500c0d2cc609164fe23bc05f8234c2c8483c8c9bc3ffffe22bbf7
+github.com/dogmatiq/dogma,v0.6.0,h1:HdJ0cTcORIxZRTB5Z7RdsBXEr18gB3so7FMIHYiAhEQ=,db91004377004aa3c5f0c462205beea995e93a0be13d7d99d3232dc03209f65c
+github.com/donovanhide/eventsource,v0.0.0-20171031113327-3ed64d21fb0b,h1:eR1P/A4QMYF2/LpHRhYAts9wyYEtF7qNk/tVNiYCWc8=,2b911efc5101522ce50399cd7831ef931896541893955441168783666811a1d1
+github.com/dop251/goja,v0.0.0-20190912223329-aa89e6a4c733,h1:cyNc40Dx5YNEO94idePU8rhVd3dn+sd04Arh0kDBAaw=,485156ad52ca9651f728a6039af63f9f11c5bf49846e513635d5fa35d8d39097
+github.com/dotcloud/docker,v1.13.1,h1:jjwxeyQYDwROaGy/YEodF+srQW5hJAnNnaTcfcKoU+0=,83884e41d26b32eae2387080b245792ac8fc0200f645aef02656cb5e4b3d0595
+github.com/drone/go-scm,v1.6.0,h1:PZZWLeSHHwdc6zbSQpg9n0CNoRB+8DAINzX9X/wJifY=,e26d2bc63c53a66252ab24a1b45ced06825bb4101cbd746c581683cf39e520b6
+github.com/dsnet/compress,v0.0.0-20171208185109-cc9eb1d7ad76,h1:eX+pdPPlD279OWgdx7f6KqIRSONuK7egk+jDx7OM3Ac=,25f6bcccb4c1cf6d97ad69253a394bd0a52a633caa623d75b30729aed495a73d
+github.com/dsnet/golib/unitconv,v0.0.0-20190531212259-571cdbcff553,h1:mE6azeVhLnKfk6DH3Zcg56L87yJ/uv9HZ5YJOQcPC4s=,603b60f7278fe7299f59d716da2bd287441f1321b5a663828d894e67bc274bed
+github.com/duosecurity/duo_api_golang,v0.0.0-20190308151101-6c680f768e74,h1:2MIhn2R6oXQbgW5yHfS+d6YqyMfXiu2L55rFZC4UD/M=,75c90bdd92362e2cc36297193a543fe0cd75c07f82182940ad6158a1d470cc8b
+github.com/dustin/go-humanize,v1.0.0,h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=,e01916e082a6646ea12d7800d77af43045c27284ff2a0a77e3484509989cc107
+github.com/dylanmei/iso8601,v0.1.0,h1:812NGQDBcqquTfH5Yeo7lwR0nzx/cKdsmf3qMjPURUI=,1e682968bfcac2115e1fd706ec6bd09a0b676d7d224514d8f8dff9cadbf87e79
+github.com/dylanmei/winrmtest,v0.0.0-20190225150635-99b7fe2fddf1,h1:r1oACdS2XYiAWcfF8BJXkoU8l1J71KehGR+d99yWEDA=,5607cb987ec0a699003eeec5952f0280792fd5db7099ca277bdfae26e93b0ef3
+github.com/eapache/go-resiliency,v1.1.0,h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU=,a64ebe539335e126b30f79f0f00f39ffe083e794995500a67e0a2156b334788e
+github.com/eapache/go-xerial-snappy,v0.0.0-20180814174437-776d5712da21,h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw=,785264afffdcfe50573a1cb0df85ff4186e9e7e4e3a04513752f52d3da1054af
+github.com/eapache/queue,v1.1.0,h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=,1dc1b4972e8505c4763c65424b19604c65c944911d16c18c5cbd35aae45626fb
+github.com/eclipse/paho.mqtt.golang,v1.2.0,h1:1F8mhG9+aO5/xpdtFkW4SxOJB67ukuDC3t2y2qayIX0=,d36337c4b5a2752b91bcd437bd74e0907bf6c9e6c611dab88407bcca8462e918
+github.com/edgexfoundry/go-mod-core-contracts,v0.1.33,h1:lQbLbRhymV0/QDDDGU26idZ9Kv+Q0IETn81hLpHxi68=,a7a8792a8692d64daea343577a49934be6ba64acbe114b3c24262537b5a9157f
+github.com/edsrzf/mmap-go,v1.0.0,h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw=,851a1d4d6e30f97ab23b7e4a6a7da9d1842f126d738f7386010c6ee7bf82518e
+github.com/edwingeng/doublejump,v0.0.0-20190102103700-461a0155c7be,h1:FnUE/uuuegwvhGE9z61q9krL5km5Mnwlusq3BT06yy8=,a9cb92422f0bbdd56c80d9873a8f7af6fd2d8d8154a7a11d7cb9232d9146f07c
+github.com/efarrer/iothrottler,v0.0.0-20141121142253-60e7e547c7fe,h1:WAx1vRufH0I2pTWldQkXPzpc+jndCOi2FH334LFQ1PI=,04291e6136b933fd2cdcc29f3af78090a9d678534a94823590eb63f1f318db1d
+github.com/efritz/backoff,v1.0.0,h1:r1DfNhA1J7p8kZ185J/hLPz2Bl5ezTicUr9KamEAOYw=,064d92e7f3e46079d158cac717e1c9bf96a230a5f31bf28940bd4a99bb91657e
+github.com/efritz/glock,v0.0.0-20181228234553-f184d69dff2c,h1:Q3HKbZogL9GGZVdO3PiVCOxZmRCsQAgV1xfelXJF/dY=,716200eb117905f4df509b7260869bb97bf8833c160d2ff1d328d01aa3874bc9
+github.com/eknkc/amber,v0.0.0-20171010120322-cdade1c07385,h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o=,b1dde9f3713742ad0961825a2d962bd99d9390daf8596e7680dfb5f395e54e22
+github.com/elastic/go-sysinfo,v1.0.1,h1:lzGPX2sIXaETeMXitXL2XZU8K4B7k7JBhIKWxdOdUt8=,fe0cd64aa3ac73edbb4240dcbcb660c4ec004f07c36371be6d78543c3b215d92
+github.com/elastic/go-windows,v1.0.0,h1:qLURgZFkkrYyTTkvYpsZIgf83AUsdIHfvlJaqaZ7aSY=,e487e6f1e269766b5815c36e93614b87a185ddc33f7a6f4bf23e5ee6d0d0e3c1
+github.com/elastic/gosigar,v0.10.5,h1:GzPQ+78RaAb4J63unidA/JavQRKrB6s8IOzN6Ib59jo=,a139252942b5ca82ddc3d9ced1daa262de0149a413149d3f0234b43dc3635acf
+github.com/elazarl/go-bindata-assetfs,v1.0.0,h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=,3aa225ae5ae4a8059a671fa656d8567f09861f88b88dbef9e06a291efd90013a
+github.com/elazarl/goproxy,v0.0.0-20191011121108-aa519ddbe484,h1:pEtiCjIXx3RvGjlUJuCNxNOw0MNblyR9Wi+vJGBFh+8=,6c224ac5720959a46f6d88e0b15dda732c7eb180b3103a826cf6d5459a5e112f
+github.com/elazarl/goproxy/ext,v0.0.0-20190711103511-473e67f1d7d2,h1:dWB6v3RcOy03t/bUadywsbyrQwCqZeNIEX6M1OtSZOM=,7244c1fe7490460503559e24e0e478540bc10481d1d8f3afd0a1f6b1a470b52f
+github.com/emicklei/go-restful,v2.11.1+incompatible,h1:CjKsv3uWcCMvySPQYKxO8XX3f9zD4FeZRsW4G0B4ffE=,9befcac63629841301235124e728206a96170afd83c78b632d271acafc9acccf
+github.com/emicklei/go-restful-swagger12,v0.0.0-20170926063155-7524189396c6,h1:V94anc0ZG3Pa/cAMwP2m1aQW3+/FF8Qmw/GsFyTJAp4=,07fd41dbe765b7d340df21d6353db8bef782f9b6742a93696b6f4133ef1d8955
+github.com/emicklei/proto,v1.6.15,h1:XbpwxmuOPrdES97FrSfpyy67SSCV/wBIKXqgJzh6hNw=,162ad34010e5f81ebed962a33c91ee6356e19631c7a7030bc9b173e85ca34678
+github.com/emirpasic/gods,v1.12.0,h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=,729ea0bda86bf801b61ff66eb019e5b9adc559cd217944abf10bb103fca573ee
+github.com/endophage/gotuf,v0.0.0-20151124190824-3b700e20e376,h1:rPyHFhsuPZMEJAe1Oj2vpRC8277wpDJJ+aabkmlHF1A=,2cd5e6d0e748e0625e8c4a08a3b9f74e311e6654a1c5411fa3a9720f5f67cf40
+github.com/envoyproxy/go-control-plane,v0.9.0,h1:67WMNTvGrl7V1dWdKCeTwxDr7nio9clKoTlLhwIPnT4=,07b3a43081c9e1cdccb95c657cba7f483d5099f9ce07b5e3f3e28ce557687521
+github.com/envoyproxy/protoc-gen-validate,v0.1.0,h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=,ec5261f3bbc426d71e2be4c76063ba12460c5d27845d630763e9e911ec4768af
+github.com/eoscanada/eos-go,v0.8.10,h1:QUwHRBHEFag/qyW4PR2S9++0se0V4LjPLk1/KsNtXlo=,f1c48e793d1c7864288871a944af4b4ee3363ad6ae5298e9c2f9f42202e6d77c
+github.com/erikstmartin/go-testdb,v0.0.0-20160219214506-8d10e4a1bae5,h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=,471feb426b2a7ec1df29cc21c66aef34c9e7aabea751328644d1362593983d21
+github.com/ernesto-jimenez/gogen,v0.0.0-20180125220232-d7d4131e6607,h1:cTavhURetDkezJCvxFggiyLeP40Mrk/TtVg2+ycw1Es=,1f3030cfc89653ba791ae312b19e420dc8eaf1bef51f59dca6aa390f3cd1f3d0
+github.com/etcd-io/bbolt,v1.3.3,h1:gSJmxrs37LgTqR/oyJBWok6k6SvXEUerFTbltIhXkBM=,6630d7aad4b10f76aea88ee6d9086a1edffe371651cc2432edfd0de6beb99120
+github.com/ethantkoenig/rupture,v0.0.0-20180203182544-0a76f03a811a,h1:M1bRpaZAn4GSsqu3hdK2R8H0AH9O6vqCTCbm2oAFGfE=,8559344c496621c06b612453de587e8e4c45c0fbc348a955f8eda7ea2b3d09c8
+github.com/ethereum/go-ethereum,v1.9.6,h1:EacwxMGKZezZi+m3in0Tlyk0veDQgnfZ9BjQqHAaQLM=,778c9bf77dd96bfaf5c3ea84498611490999782fb37edf8257680e27dd8976e8
+github.com/euank/go-kmsg-parser,v2.0.0+incompatible,h1:cHD53+PLQuuQyLZeriD1V/esuG4MuU0Pjs5y6iknohY=,43cadfa5ab226f89ca7a715add32ba23c554a5dfafd3a55449856a6b7012f946
+github.com/evanphx/json-patch,v4.5.0+incompatible,h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M=,5508e810685a5081a3e880aeb24e501bd87920241baa317bfb5f3946b4fa417c
+github.com/exoscale/egoscale,v0.18.1,h1:1FNZVk8jHUx0AvWhOZxLEDNlacTU0chMXUUNkm9EZaI=,8cb4f10504b54d31c71bc4a670171a074f7abbab67d939fd404b62ad36cb6aed
+github.com/facebookgo/atomicfile,v0.0.0-20151019160806-2de1f203e7d5,h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A=,3c9bdee73452cc12c2936b4050d638d36302a958091ceb49c45ffbaff8954218
+github.com/facebookgo/clock,v0.0.0-20150410010913-600d898af40a,h1:yDWHCSQ40h88yih2JAcL6Ls/kVkSE8GFACTGVnMPruw=,5d6b671bd5afef8459fb7561d19bcf7c7f378da9943722d36676735b3c6272fa
+github.com/facebookgo/ensure,v0.0.0-20160127193407-b4ab57deab51,h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ=,a96c69c2b5902e0383139ee7089877a5ae2ddcd4eba42a595d13b570907d3fdc
+github.com/facebookgo/freeport,v0.0.0-20150612182905-d4adf43b75b9,h1:wWke/RUCl7VRjQhwPlR/v0glZXNYzBHdNUzf/Am2Nmg=,0f717d7eb52e276aec2138a971b091cd04da95826c8f451a20e8e78c4bb8f915
+github.com/facebookgo/grace,v0.0.0-20160926231715-5729e484473f,h1:0mlfEUWnUDVZnqWEVHGerL5bKYDKMEmT/Qk/W/3nGuo=,79f9f73ef925d457d2b70d37b12c3cec97a2e84e73a932397d2f569ec8702ee7
+github.com/facebookgo/httpdown,v0.0.0-20160323221027-a3b1354551a2,h1:3Zvf9wRhl1cOhckN1oRGWPOkIhOketmEcrQ4TeFAoR4=,dbbccf963238c5f80c54edb19aeb016f486f42dcd922fc0be5b832af9449ca4b
+github.com/facebookgo/inject,v0.0.0-20161006174721-cc1aa653e50f,h1:jK9r9Ofgc/Yzdlod77G23LfYtwqAmkQCZ9MaP6779OI=,6292702ff520e1fb14231f29bb2639d8f39edc08de479d76757ad97dafbb9174
+github.com/facebookgo/stack,v0.0.0-20160209184415-751773369052,h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A=,0afd18a8394caa29e94bd58a42e0d2be07939f9daf190a9ba2a947f9cbd4ba1a
+github.com/facebookgo/stats,v0.0.0-20151006221625-1b76add642e4,h1:0YtRCqIZs2+Tz49QuH6cJVw/IFqzo39gEqZ0iYLxD2M=,d87443825721dc1dd5c358cd9e55b917ee1c3b6b10ab9557375f59d563b628cb
+github.com/facebookgo/structtag,v0.0.0-20150214074306-217e25fb9691,h1:KnnwHN59Jxec0htA2pe/i0/WI9vxXLQifdhBrP3lqcQ=,3a9c84e9dc2b9960f1de3cc7a61d91fe2978e64e4e4859a9383259092ec91c5e
+github.com/facebookgo/subset,v0.0.0-20150612182917-8dac2c3c4870,h1:E2s37DuLxFhQDg5gKsWoLBOB0n+ZW8s599zru8FJ2/Y=,bb18c678177e1aaaae209a2de9c28b5b7acc34e58fe00517b847a9460bd42df2
+github.com/farsightsec/golang-framestream,v0.0.0-20190425193708-fa4b164d59b8,h1:/iPdQppoAsTfML+yqFSq2EBChiEMnRkh5WvhFgtWwcU=,084f0ac3684b180e3d87db3e7b36a412c750397fbf009579e126c304528c1738
+github.com/fatih/camelcase,v1.0.0,h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=,54664f64f1f24097b80c64b9f606cbe8d8bc410a755ce6cda4f45e46f1141984
+github.com/fatih/color,v1.7.0,h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=,6036f0b31167280b696b5efb43603e71bce31420fb3428afdf74a68bb3a3ebef
+github.com/fatih/structs,v1.1.0,h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=,a361ecc95ad12000c66ee143d26b2aa0a4e5de3b045fd5d18a52564622a59148
+github.com/fatih/structtag,v1.0.0,h1:pTHj65+u3RKWYPSGaU290FpI/dXxTaHdVwVwbcPKmEc=,347fce3911900f5947735c12ccb4c6fbe0199c6df040bcaa4d74a8587af896d0
+github.com/fd/go-nat,v1.0.0,h1:DPyQ97sxA9ThrWYRPcWUz/z9TnpTIGRYODIQc/dy64M=,bdf011af97da57ef3c58a091ae760eb885a6322faa3539d3c37bf76d4fff536a
+github.com/fernet/fernet-go,v0.0.0-20180830025343-9eac43b88a5e,h1:P10tZmVD2XclAaT9l7OduMH1OLFzTa1wUuUqHZnEdI0=,a484a3172222095507a7f1901a91ab741c28278ea6b878c21c1151c0fd40f46d
+github.com/flosch/pongo2,v0.0.0-20190707114632-bbf5a6c351f4,h1:GY1+t5Dr9OKADM64SYnQjw/w99HMYvQ0A8/JoUkxVmc=,814b52f668d2e2528fe9af917506cda4894d22c927283cfb8aaf6857503dfc5a
+github.com/flynn/go-shlex,v0.0.0-20150515145356-3f9db97f8568,h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=,ea68a1d391e59ebc04ce986b88e000327bb141e5e8e80ef93af950bca42bb4cc
+github.com/fogleman/gg,v1.3.0,h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=,792f7a3ea9eea31b7947dabaf9d5a307389245069078e4bf435d76cb0505439c
+github.com/forestgiant/sliceutil,v0.0.0-20160425183142-94783f95db6c,h1:pBgVXWDXju1m8W4lnEeIqTHPOzhTUO81a7yknM/xQR4=,bedd47c23670847642576777cc8b53b9dd8a5a8e7b0a6f2299ebc6fa3b7b6f00
+github.com/fortytw2/leaktest,v1.3.0,h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=,867e6d131510751ba6055c51e7746b0056a6b3dcb1a1b2dfdc694251cd7eb8b3
+github.com/francoispqt/gojay,v1.2.13,h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk=,f41e3e4f3086400448dbce1c06c59f5848a6c5983e5466689965e3a2cabcba7c
+github.com/frankban/quicktest,v1.5.0,h1:Tb4jWdSpdjKzTUicPnY61PZxKbDoGa7ABbrReT3gQVY=,515b5b2b9320b2982193ad6bd118907aaab9ff62189870e00be459cc4097073c
+github.com/fsnotify/fsnotify,v1.4.7,h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=,1d09ad8f3dc41cb6e0288023b47272c1c9393ca411e48f4b5009bca6662dc3ad
+github.com/fsouza/fake-gcs-server,v1.2.0,h1:FZUL/EJlyAlHxpUWZs23ae4zNwBwmHM1p5TykkoP85A=,83b547a0780693f154c30137b1eeaf0c0e9628798ae4b7e1d74ebfb8efaf61fc
+github.com/fsouza/go-dockerclient,v1.5.0,h1:7OtayOe5HnoG+KWMHgyyPymwaodnB2IDYuVfseKyxbA=,c7025b816e0ba28041a88b1063003f4e31097346d06cf69811f9d55505d3d46c
+github.com/fullsailor/pkcs7,v0.0.0-20190404230743-d7302db945fa,h1:RDBNVkRviHZtvDvId8XSGPu3rmpmSe+wKRcEWNgsfWU=,ba36a8fc855d6eecef329d26f8e82132e38d45d06f79f88d3b0bde6d718c8fb2
+github.com/fuyufjh/splunk-hec-go,v0.3.3,h1:7PLVIODblK9FXfuAy8iPZg0lcw1YNzSQHfC+0NYgUxU=,9517f63386f64e0dceca9352f45eb7f160452682a07fa04d3c1ff90eb19ac83d
+github.com/gabriel-samfira/sys,v0.0.0-20150608132119-9ddc60d56b51,h1:rUp9t/FbeJM3R3BSYkJfViN3CNQcmk44H20SqkJ/y+k=,1be262d101bd9079bb859639ad6d5eaee80646b6db0fcbeb7146d9381949d2a8
+github.com/gammazero/deque,v0.0.0-20190130191400-2afb3858e9c7,h1:D2LrfOPgGHQprIxmsTpxtzhpmF66HoM6rXSmcqaX7h8=,a1fe4ec3258f68685ee45b68e1d9188d79726af46a1b93281cf11ddc6045a864
+github.com/gammazero/workerpool,v0.0.0-20190406235159-88d534f22b56,h1:VzbudKn/nvxYKOdzgkEBS6SSreRjAgoJ+ZeS4wPFkgc=,cbb92fdf8d457e27923dc6515af4458a55af932ccf468415c8b36bf49845fc00
+github.com/garyburd/go-oauth,v0.0.0-20180319155456-bca2e7f09a17,h1:GOfMz6cRgTJ9jWV0qAezv642OhPnKEG7gtUjJSdStHE=,be051ba0d52eaced1c1985ebdf2dece3f7127ad392645b42fd06c2af9c9caea2
+github.com/garyburd/redigo,v1.6.0,h1:0VruCpn7yAIIu7pWVClQC8wxCJEcG3nyzpMSHKi1PQc=,68f0d2b454f7a9a000c3335fc0f409123637e4711c6461a4c75e2f128f68f283
+github.com/gavv/monotime,v0.0.0-20161010190848-47d58efa6955,h1:gmtGRvSexPU4B1T/yYo0sLOKzER1YT+b4kPxPpm0Ty4=,c97324768edc8170e05b8925b0551778909c8e15817d4327ac405a4e0b6071f4
+github.com/gcash/bchd,v0.14.7,h1:n3gMXCT4VhU/emiCq61kmKBPADLxBzpX5IlXPnGuR2c=,871644f504d6c3f19dcfc8a7a6e6aa623e6642275a48dfffe770ec61368c2032
+github.com/gcash/bchlog,v0.0.0-20180913005452-b4f036f92fa6,h1:3pZvWJ8MSfWstGrb8Hfh4ZpLyZNcXypcGx2Ju4ZibVM=,d400c8e944edf2a67f46e75335f55c14170c523691804ea71e1a348ad45bc7e7
+github.com/gcash/bchutil,v0.0.0-20191012211144-98e73ec336ba,h1:KVa96lSrJGMYZ414NtYuAlbtCgrmW9kDnjvYXcLrr5A=,7b829a35d22ead0ee82d8a98b1e06da5e63fd07b2798fce8ba87c8da670ef04a
+github.com/gcla/gowid,v1.0.0,h1:78Xf5G9+lb4/g3KCB3hX8UJ8VorymMH5PXu9Npvwf8s=,eaa7e0b7bb0912c6b24c98dee0073a2de754c24e1347ce7c5bfc63397ccf0fa6
+github.com/gdamore/encoding,v1.0.0,h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=,638a9832e2f62d118d7c511d86bdae1622a51f331de48a01d929fd24ebe6a2a6
+github.com/gdamore/tcell,v1.3.0,h1:r35w0JBADPZCVQijYebl6YMWWtHRqVEGt7kL2eBADRM=,97c1e828ff9de0cef3a5bbdb3f3def8a351ad6ca65a780d4dd4141b0ee23c88e
+github.com/genuinetools/pkg,v0.0.0-20180910213200-1c141f661797,h1:SGpZXDd/CFeDIY4Rq5cFO8K/uqDblHUxjlzOmjFpvRg=,c15cbe95e0a7e38cc0a790b0098170c103ba84d56e7cbaf744a6df10c00efa45
+github.com/genuinetools/reg,v0.16.0,h1:ZhLZPT+aUGHLfy45Ub5FLWik+3Dij1iwaj8A/GyAZBw=,a505ff5357d6095540c89ee27d207a3a4dc7c73840fb6bc9a2f0f3a81e498341
+github.com/gernest/wow,v0.1.0,h1:g9xdwCwP0+xgVYlA2sopI0gZHqXe7HjI/7/LykG4fks=,b49d5efc34e19469e7319df09b35438de307ba7cd8c9333ecba190f457ca8e22
+github.com/getgauge/common,v0.0.0-20190514095629-619e107433ce,h1:/ofMj8gIhPYdb/JEXKj8iYe5Yxl3mrK8YA7yl/06t6Y=,04ab4fb7e8dcf693c3b79028693130cd51fe54f5a16f12622975a7c3eb7705f7
+github.com/getlantern/context,v0.0.0-20190109183933-c447772a6520,h1:NRUJuo3v3WGC/g5YiyF790gut6oQr5f3FBI88Wv0dx4=,27515ae761018c4cfc83043194904170bef0cac037c48ff96fc497502b9bab14
+github.com/getlantern/errors,v0.0.0-20190325191628-abdb3e3e36f7,h1:6uJ+sZ/e03gkbqZ0kUG6mfKoqDb4XMAzMIwlajq19So=,a48d7684463e8c496fea4a2595ca71012c3b222bc77de7c2ddfbe78bc4595ac5
+github.com/getlantern/fdcount,v0.0.0-20170105153814-6a6cb5839bc5,h1:8Q9iN/V24EG01IgXEKVScth/rTXpplBxCYio/yIKtUw=,b24c26d5ede197fd6b7f981cf5db300124e22f48667942c948a9750f7a908c94
+github.com/getlantern/golog,v0.0.0-20190830074920-4ef2e798c2d7,h1:guBYzEaLz0Vfc/jv0czrr2z7qyzTOGC9hiQ0VC+hKjk=,1eeabfbc56105f3d751e1947405f5296db5ded7e25900209fe7327f1b5d785e6
+github.com/getlantern/hex,v0.0.0-20190417191902-c6586a6fe0b7,h1:micT5vkcr9tOVk1FiH8SWKID8ultN44Z+yzd2y/Vyb0=,ea5a13f98a82c1919c59b655de531cbb35ac7dfff3c99072b43b8bfd1c29b774
+github.com/getlantern/hidden,v0.0.0-20190325191715-f02dbb02be55,h1:XYzSdCbkzOC0FDNrgJqGRo8PCMFOBFL9py72DRs7bmc=,c901f2e702114d6268446a381a27737c6123e50191197fd84f17b339238191b4
+github.com/getlantern/idletiming,v0.0.0-20190529182719-d2fbc83372a5,h1:laM1s/bxUH8xbbC9TBGWsOc7A0KCAPZMa4pdwO5e6Vw=,35de51b383e926042d3f8f4859e2d961582cf9964d3b7bb513ac4733cc43162f
+github.com/getlantern/mockconn,v0.0.0-20190403061815-a8ffa60494a6,h1:+aO65ByJw74kV8vXqvkj49P5RtIqyUObyeRTIxMz218=,a4a1ccdc9ec68dea571d9603d4a36150b6ccaea447ca88965e088ff0b9eeaa0d
+github.com/getlantern/mtime,v0.0.0-20170117193331-ba114e4a82b0,h1:1VNkP55LM/W2IwWN+qi+5X3gZcEQHfj8X9E+FNxVgM4=,5af0b20838a808b86a2a9c87c254d47185d38d5935780dade3bc7a54dc2880f4
+github.com/getlantern/netx,v0.0.0-20190110220209-9912de6f94fd,h1:mn98vs69Kqw56iKhR82mjk16Q1q5aDFFW0E89/QbXkQ=,cb386d0527fb6f549fa0266c770a68d7d83a88bab2194d25b55355f59198fdf0
+github.com/getlantern/ops,v0.0.0-20190325191751-d70cb0d6f85f,h1:wrYrQttPS8FHIRSlsrcuKazukx/xqO/PpLZzZXsF+EA=,321694d3d2f31415653a7b9d97a4a701f36f10ccfbbdb94449f1211137d6f215
+github.com/getsentry/raven-go,v0.2.0,h1:no+xWJRb5ZI7eE8TWgIq1jLulQiIoLG0IfYxv5JYMGs=,eaffe69939612cd05f95e1846b8ddb4043655571be34cdb6412a66b41b6826eb
+github.com/gf-third/mysql,v1.4.2,h1:f1M5CNFUG3WkE07UOomtu4o0n/KJKeuUUf5Nc9ZFXs4=,14a08134ce02bd0d07667da91a89c9098d18bad8c790414e37aba906895a5a3e
+github.com/gf-third/yaml,v1.0.1,h1:pqD4ix+65DqGphU1MDnToPZfGYk0tuuwRzuTSl3g0d0=,6354a95d7faa222d2e653485bc9dd555aad61a75eb5a5f970de531391ed77a2f
+github.com/ghetzel/go-defaults,v1.2.0,h1:U1T64bxhBc6nVZ68QXch1hoHq43h6isqgbvG7kxY9Uc=,f339e441d08af3af184a21f518227db7c705851be82f3fcea611e762ebb633a1
+github.com/ghetzel/go-stockutil,v1.8.6,h1:VgqpePUGGXMHjgArUH5mSAYFC35aiFgkU/TdTU/ts80=,aa0cce06af82b7d1f98a20deaafd6997fa7c3d36fba9a204a34e5d91a2096fa0
+github.com/ghetzel/testify,v1.4.1,h1:wpJirdM+znAnxWruGDBdIys5aU+wGJHNUTkgEo4PYwk=,90206efc10ad71a33bf314ef768d16c6186d23ccb5aa8172663437d497dbfdd7
+github.com/ghetzel/uuid,v0.0.0-20171129191014-dec09d789f3d,h1:YVJe7KwVYazt90hCc/q2dYJVS3062AY6QdT6iHd+Kh8=,924f39fe83589fa269e652c8ca4f7b0dbc59023baada8a55c24692fe5223b67a
+github.com/ghodss/yaml,v1.0.1-0.20190212211648-25d852aebe32,h1:Mn26/9ZMNWSw9C9ERFA1PUxfmGpolnw2v0bKOREu5ew=,9771720da98bbdd80dacdefb47b9a0e36faa75caa4745149d150325ba5390e4b
+github.com/gin-contrib/gzip,v0.0.1,h1:ezvKOL6jH+jlzdHNE4h9h8q8uMpDQjyl0NN0Jd7jozc=,e994ecc5881938978d6d031e3d0c1bc5968bfe5de2a307aed7c63aecba459ecd
+github.com/gin-contrib/sse,v0.1.0,h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=,512c8672f26405172077e764c4817ed8f66edc632d1bed205b5e1b8d282816ab
+github.com/gin-gonic/gin,v1.4.0,h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ=,b9bc661bf658179d53fee9e7c587eba4df8326d0c26ad29f785739a78313fc4b
+github.com/glacjay/goini,v0.0.0-20161120062552-fd3024d87ee2,h1:+SEORW3KptcFnlhTbn7N0drG3AFnrcmBDWDyQ3Bt06o=,061319068788a9eeef67d4e5cf84a87c4649005aaa4f37c983a868c357e3df3c
+github.com/gliderlabs/ssh,v0.2.2,h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=,f9f12d766ceeab9e2134504520de75819d1eeb6733b8b619b7bcd4aac4cca983
+github.com/globalsign/mgo,v0.0.0-20181015135952-eeefdecb41b8,h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is=,c07f09e0c93e6410076edfd621d2decbd361361c536c3e33ba097fa51708f360
+github.com/glycerine/go-unsnap-stream,v0.0.0-20180323001048-9f0cb55181dd,h1:r04MMPyLHj/QwZuMJ5+7tJcBr1AQjpiAK/rZWRrQT7o=,9a66d6f9bb1a268f4b824d6fe7adcd55dc17ed504683bdf2dbf67b32028d9b88
+github.com/glycerine/goconvey,v0.0.0-20190315024820-982ee783a72e,h1:SiEs4J3BKVIeaWrH3tKaz3QLZhJ68iJ/A4xrzIoE5+Y=,344fb699344a5ab09464c0283a65402ae0fe6bd6fac7d40e9c4d403cf4a7714f
+github.com/gmallard/stompngo,v1.0.12,h1:uj1Bl9o+dqn0qSR33xHmaKw21W5LzhWo4Q4hS1MCpQU=,88498e4da4e0f7f3923d758a464d53f550921617b1047643def2a973c86dfd03
+github.com/go-aah/forge,v0.8.0,h1:sk4Z523B9ay3JQF4At97U7kecB5yTIm0J2UM/qRVXbQ=,e883adcfb380d6187de84c59a0f8bb3b34931487151873d7a326a1b4df556e48
+github.com/go-acme/lego,v2.7.2+incompatible,h1:ThhpPBgf6oa9X/vRd0kEmWOsX7+vmYdckmGZSb+FEp0=,1a597873ff61c0fbdab6b4f1027141d2e8dbe739bd2018473559bec954f3e651
+github.com/go-acme/lego/v3,v3.1.0,h1:yanYFoYW8azFkCvJfIk7edWWfjkYkhDxe45ZsxoW4Xk=,fbb3cfe2619281c3ccd456b213b5f8c7bf695f82ecac6c97f747dc4159dfe4b2
+github.com/go-ble/ble,v0.0.0-20190521171521-147700f13610,h1:eWay3GzFqTJUEYN1BrbqdDTFeFUGmYLps8SQkn1D7Yo=,a5fb6440935dd7ef8bb3569bc7260bd1ad44e01d41bbb684dbb96cc677fb2234
+github.com/go-chassis/foundation,v0.0.0-20190621030543-c3b63f787f4c,h1:p+Y6yq7RwHmYjEr/vwdVYGacBqFCc2lPQfNRIC3vRIs=,db38c108455e57b3f8f062c22872554d5af9dfa03a723c9fea263a009f3002e6
+github.com/go-chassis/go-archaius,v0.24.0,h1:ubNgs3Rv067PI7t37ZJoIMaPPHIBWV+ni/e7XAdW1hU=,37b0c60692eaed91abd3d2c6a0fc9366a54882f3a6b5ef81f3cc20d14882a13d
+github.com/go-chassis/go-chassis,v1.7.3,h1:7fcfaE9Ij+oBbf2lHoHHIvxT9objtt1EHpwRPBUkDhw=,38f8393558528b0212674268f6dc507d5db716fc5745eff09bccf1cd98b86eb7
+github.com/go-chassis/go-chassis-config,v0.14.0,h1:OnM9sx2GalDC7vEIhPecRpQlVa8hz10NOB41+9tii5A=,afc7506eec8591a5ccbb08f073ba19312bc03d87ec15c1532f5daba02f090e00
+github.com/go-chassis/go-restful-swagger20,v1.0.1,h1:HdGto0xroWGK504XN0Um7JBc0OPMHDlWwedkd2mTGII=,2c41388f71dc766088fc3e47e91a2f8c2d7936e40f6a64afff53a12ef73e0d05
+github.com/go-chassis/paas-lager,v1.0.2-0.20190328010332-cf506050ddb2,h1:iORWPbIQ81tJPKWs9TNvcjCQnqvyTlL41F9ILgiTcyM=,a74c06554cf6835e98c4fa548a4aa3dcc317ca93567af893b89a4dba88b783af
+github.com/go-chat-bot/bot,v0.0.0-20191022130543-3da6cae45477,h1:JfUELmxvEz/MXI3/iSn2UcB/5CCAvMsxKi88j783ssk=,a059cd1d050747bd0adcd3d4ba91e12b0ace2c038187484726c3d551169d9fa4
+github.com/go-chat-bot/plugins,v0.0.0-20181006134258-491b3f9878d6,h1:qNYjVQnDwznjLk+OnNdczA5SXwEa/RwjPTZSQCKofF4=,b19527108aef487fa1f4856e354f4777644a574248cc7e891bacf1bfb38bd12d
+github.com/go-chat-bot/plugins-br,v0.0.0-20170316122923-eb41b30907dc,h1:v/poG4Y4O/z1cUm2cWxiIkFFgRsT3Fe1u1A33evx89g=,6b613e62d3f389f3d6f8f262903bc31c4f1eb4b3ca8d192606f78199b1af0d43
+github.com/go-check/check,v0.0.0-20190902080502-41f04d3bba15,h1:xJdCV5uP69sUzCIIzmhAw6EKKdVk3Tu48oLzM86+XPI=,93bbc1f982dd553e279fb4c7fbc060032096e2b5d0537385ae80247492a6433e
+github.com/go-chi/chi,v4.0.2+incompatible,h1:maB6vn6FqCxrpz4FqWdh4+lwpyZIQS7YEAUcHlgXVRs=,25c94ccd43f18002c2dd07e87da1dc393ff87d615441e559bda425ea0979715b
+github.com/go-cmd/cmd,v1.0.5,h1:IK23uTRWxq6UJnNWp8nKO7mVCwnPfbaxA2lhzEKfNj0=,2623aa43dbf68c24362bcfb7a216b83c2e7473d4a3e49e7955c3fa5f28b4974c
+github.com/go-delve/delve,v1.3.2,h1:K8VjV+Q2YnBYlPq0ctjrvc9h7h03wXszlszzfGW5Tog=,b8a250f2b3ef87da34fbfc655bb23a051b43672bea7a8abc4e083a2b214faf09
+github.com/go-errors/errors,v1.0.1,h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=,bdbee3143e1798eadff4df919479c28ec2d3299a97d445917bc64d6eb6a3b95a
+github.com/go-gl/gl,v0.0.0-20181026044259-55b76b7df9d2,h1:78Hza2KHn2PX1jdydQnffaU2A/xM0g3Nx1xmMdep9Gk=,499822d1b3bcc34b82df0fcc13ac9a0ea273c5d68b3e183e18fa76dab9793954
+github.com/go-gl/glfw,v0.0.0-20190409004039-e6da0acd62b1,h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0=,96c694c42e7b866ea8e26dc48b612c4daa8582ce61fdeefbe92c1a4c46163169
+github.com/go-gl/mathgl,v0.0.0-20190713194549-592312d8590a,h1:yoAEv7yeWqfL/l9A/J5QOndXIJCldv+uuQB1DSNQbS0=,39948d90a5672c7866b5b1c01e9e8ce6c80c099306ed80e9e138350840f82110
+github.com/go-ini/ini,v1.49.0,h1:ymWFBUkwN3JFPjvjcJJ5TSTwh84M66QrH+8vOytLgRY=,4820559fd3640c6b5361a7077e8b5c1a4318a06a59df7a095cbf96514d46d432
+github.com/go-kit/kit,v0.9.0,h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk=,f3da9b35b100dd32e7b10c37a0630af60d54afa37c61291e7df94bc0ac31ed03
+github.com/go-ldap/ldap,v3.0.3+incompatible,h1:HTeSZO8hWMS1Rgb2Ziku6b8a7qRIZZMHjsvuZyatzwk=,4197e5fbebc7a1805be236cf75dea301f0b8e15a857e2373653b76157c649f93
+github.com/go-log/log,v0.1.0,h1:wudGTNsiGzrD5ZjgIkVZ517ugi2XRe9Q/xRCzwEO4/U=,ec5845d33a6d7ede81970833cfc3179d53b99019da1ebffef5e71005ff94be43
+github.com/go-logfmt/logfmt,v0.4.0,h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA=,d678198dc0eeaed28736e0d71b919a0bd98501b7275c69a7917122f6de9e0d1c
+github.com/go-logr/logr,v0.1.0,h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg=,4c14b7c05eaa48b7f8dbf2ca38c3603dce446f4184a4c0af2f569b046d66201e
+github.com/go-logr/zapr,v0.1.0,h1:h+WVe9j6HAA01niTJPA/kKH0i7e0rLZBCwauQFcRE54=,7b60c74f722b8f215711503dd63576845987eff81ef5f9dc052fc9158d1c57e2
+github.com/go-macaron/binding,v1.0.0,h1:ILEIP1e9GaXz//fZIl1zXgHVbM9j1SN89aTGOq8340Y=,3887f50d442cd8f9eeeb0e7710c7cba41c185d8e5a82404ff33e7cbd4e16d0c7
+github.com/go-macaron/cache,v0.0.0-20151013081102-561735312776,h1:UYIHS1r0WotqB5cIa0PAiV0m6GzD9rDBcn4alp5JgCw=,a854b7844fff9ec69025db12a2b03834a2eac570a366962c4eb83984813a9fdb
+github.com/go-macaron/captcha,v0.0.0-20190710000913-8dc5911259df,h1:MdgvtI3Y1u/DHNj7xUGOqAv+KGoTikjy8xQtCm12L78=,fb1c643c72ba9ef2c5d613e324e47dbb17ce45a28cbee8cb540ea48a0b3d6a23
+github.com/go-macaron/cors,v0.0.0-20190418220122-6fd6a9bfe14e,h1:auESkcVctNZnNl4EH0TuoCSJMJ7Q7ShU8FS6lDEsAC4=,0f3043631d54efca5615fe7ed819523bbe0c18726ce9e4b0cdc0ef2879aa6044
+github.com/go-macaron/csrf,v0.0.0-20180426211211-503617c6b372,h1:acrx8CnDmlKl+BPoOOLEK9Ko+SrWFB5pxRuGkKj4iqo=,90b5cbd86ff3708d41be70ad3cde77fdedd5ef485b960cc3a9ffea6f0a14902c
+github.com/go-macaron/gzip,v0.0.0-20191101043656-b5609500c6fc,h1:z3gfrCJUPhdRHtd8kftnNBzI5ayZ1zQhWARPeL83JNQ=,dfcc1200b66bcb581c6984da9fa4aefc92facc3a07d182c7c37f0978b41b868f
+github.com/go-macaron/i18n,v0.0.0-20160612092837-ef57533c3b0f,h1:wDKrZFc9pYJlqFOf7EzGbFMrSFFtyHt3plr2uTdo8Rg=,6c1d5fe7ed23e05ca1af7462e6deac2d993ddacd099ad794faad5c685337742d
+github.com/go-macaron/inject,v0.0.0-20160627170012-d8a0b8677191,h1:NjHlg70DuOkcAMqgt0+XA+NHwtu66MkTVVgR4fFWbcI=,666bb04a5df1271326b4fcdbbdc3276400ae7e54f4ed6233792cd6e519676491
+github.com/go-macaron/session,v0.0.0-20191101041208-c5d57a35f512,h1:7ndsXTX42iYHryQz98zUsBJfStJ0kXFKgDrPmRvR400=,3581a7eb19a2a60d41aba7e85afa576c35a97659e162b83292ff67396f899845
+github.com/go-macaron/toolbox,v0.0.0-20180818072302-a77f45a7ce90,h1:3wYKrRg9IjUMfaf3H0Hh7M5Li9ge79Y7aw2yujHa2jQ=,43f2a06502408404c3b1231c3642693632cf20bc4f2cb45881bd2292b1eed714
+github.com/go-martini/martini,v0.0.0-20170121215854-22fa46961aab,h1:xveKWz2iaueeTaUgdetzel+U7exyigDYBryyVfV/rZk=,0561a4dadd68dbc1b38c09ed95bbfc5073b0a7708b9a787d38533ebd48040ec2
+github.com/go-mesh/openlogging,v1.0.1,h1:6raaXo8SK+wuQX1VoNi6QJCSf1fTOFWh7f5f6b2ZEmY=,3606bad571f959cc24382381f7d50fb321819958df37911f6ad6aa5ac3e02181
+github.com/go-ole/go-ole,v1.2.4,h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=,c8b3ef1187d2d7dbfddc4badefcc992c029cd377ae07bff2fa05ec8972836612
+github.com/go-openapi/analysis,v0.19.5,h1:8b2ZgKfKIUTVQpTb77MoRDIMEIwvDVw40o3aOXdfYzI=,22e5ff3f88802059aa86835d8f7c25386afed1159d4e951ef0f87ef62ab4a253
+github.com/go-openapi/errors,v0.19.2,h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY=,e02e448e5a2c1ff2a011f74d41d505a2f32b369551064940630d6660c600bf3d
+github.com/go-openapi/inflect,v0.19.0,h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=,fbcca36e347a2f560f50ac1c9c63f7d6cd97c8dff9800f08f370b5ce09b77c57
+github.com/go-openapi/jsonpointer,v0.19.3,h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w=,1fe6122c9c9d10837439398976a2ff55e8ed905fa7e4a66f3fb0e857c6e06582
+github.com/go-openapi/jsonreference,v0.19.2,h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w=,00b2457c2d091a9817f91f55655a334bed8f75b2d6499ba9192f12564dd51dd9
+github.com/go-openapi/loads,v0.19.4,h1:5I4CCSqoWzT+82bBkNIvmLc0UOsoKKQ4Fz+3VxOB7SY=,adffcd0e2900bf0cca893e6bf014db55ebf161476367ac4dd365f8481c12616f
+github.com/go-openapi/runtime,v0.19.7,h1:b2zcE9GCjDVtguugU7+S95vkHjwQEjz/lB+8LOuA9Nw=,4017d9c69d9d2789d0a3b50c6af509831c0f24bfc545f1b43224df2fc5194dbd
+github.com/go-openapi/spec,v0.19.4,h1:ixzUSnHTd6hCemgtAJgluaTSGYpLNpJY4mA2DIkdOAo=,7c12cf07de1b65175474fdde12110716ab237fa862694e4e5051eb15541a964e
+github.com/go-openapi/strfmt,v0.19.3,h1:eRfyY5SkaNJCAwmmMcADjY31ow9+N7MCLW7oRkbsINA=,07b9c9b2da9dffc0a830e6536b705282fd17023fe8d04aa909fe1e4e3b6306f5
+github.com/go-openapi/swag,v0.19.5,h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=,54aec6bdc63d1d6609c32b140fe74d099f8b9628d362689556537506724eaeda
+github.com/go-openapi/validate,v0.19.4,h1:LGjO87VyXY3bIKjlYpXSFuLRG2mTeuYlZyeNwFFWpyM=,2b1b2612db93ed3fb411cc798150821af5c031b120097bbe6578dc4ce2d6d1df
+github.com/go-playground/locales,v0.13.0,h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=,9c4b65273e135b1bdb9bafc7c0b5180a6c5936f54edecbc8807c57a9d107c6b9
+github.com/go-playground/overalls,v0.0.0-20180201144345-22ec1a223b7c,h1:3bjbKXoj7jBYdHpQFbKL2546c4dtltTHzjo+5i4CHBU=,7972d7c49470ee2e187868b30d3157ca58201f50a934caa75ce4d5b134a2a644
+github.com/go-playground/universal-translator,v0.16.0,h1:X++omBR/4cE2MNg91AoC3rmGrCjJ8eAeUP/K/EKx4DM=,316fba5fa26a586e39fc11698c16e67edabd122efe26f7fff71091a00a59883a
+github.com/go-redis/redis,v6.15.6+incompatible,h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg=,e277bbc2acb8462aca5e20ef7569a733501bc765f65303a6e5153a86e6e3090c
+github.com/go-sourcemap/sourcemap,v2.1.2+incompatible,h1:0b/xya7BKGhXuqFESKM4oIiRo9WOt2ebz7KxfreD6ug=,1bdaec84a31896eee149acb563f8af0b3ce7899d916383e0b597d6b480b6a622
+github.com/go-sql-driver/mysql,v1.4.1,h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=,f128045df19d340743a155ef282116130d27e27cbc62de160b6072c751b435ba
+github.com/go-stack/stack,v1.8.0,h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=,78c2667c710f811307038634ffa43af442619acfeaf1efb593aa4e0ded9df48f
+github.com/go-swagger/go-swagger,v0.20.1,h1:37XFujv7lYHLOKawfzLDg4STwwgB5zhPjodN33asJto=,79cc2c57c4e9d03a9399577b942eface46073ee6fa289b86651f1c5d0c513484
+github.com/go-swagger/scan-repo-boundary,v0.0.0-20180623220736-973b3573c013,h1:l9rI6sNaZgNC0LnF3MiE+qTmyBA/tZAg1rtyrGbUMK0=,51aed4b67bce9d988d64ca6be9de2169f709a29d5ea83e78ffb1c2432b346ec6
+github.com/go-telegram-bot-api/telegram-bot-api,v4.6.4+incompatible,h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU=,a0d2549e07c67e066337cc6eadd8be2a961d13b493d4325603010d4e35e519df
+github.com/go-test/deep,v1.0.3,h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=,d199ce762552766bd3baf37ae4b0255bb6a6fecf144e8ae5fa3a94f1ce30a180
+github.com/go-xorm/builder,v0.3.4,h1:FxkeGB4Cggdw3tPwutLCpfjng2jugfkg6LDMrd/KsoY=,81028f69e261c29566c24f4717458d04dbe92aebc4eb93a41c1cfeef13b7c5dd
+github.com/go-xorm/core,v0.6.0,h1:tp6hX+ku4OD9khFZS8VGBDRY3kfVCtelPfmkgCyHxL0=,8a8c43c039422f38e1775a835bda46e62f4a055b4b38d57967c0e7a6c9b21d23
+github.com/go-xorm/sqlfiddle,v0.0.0-20180821085327-62ce714f951a,h1:9wScpmSP5A3Bk8V3XHWUcJmYTh+ZnlHVyc+A4oZYS3Y=,e539a37b8fb0d23c21e9eb1fe34db0ffcf19e5e4ae3d3b7049bb23c722c4b382
+github.com/go-xorm/xorm,v0.7.9,h1:LZze6n1UvRmM5gpL9/U9Gucwqo6aWlFVlfcHKH10qA0=,8836904c60cf227804fc843c707cd3e99122b95a97801d09dd2bddce4ed5a29f
+github.com/go-yaml/yaml,v2.1.0+incompatible,h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o=,842989ea2e54ba8e4ef49cca914a5cd37176c44ccd3bb3e8c44fcbc10cb7832e
+github.com/gobuffalo/attrs,v0.1.0,h1:LY6/rbhPD/hfa+AfviaMXBmZBGb0fGHF12yg7f3dPQA=,06c6c210a26c85ae291efe9d54cab9cab26fd1453f4f48962e04c89760e775d0
+github.com/gobuffalo/buffalo,v0.15.0,h1:VsxIcfJaDm4u2UirLHGgMfQpfHVwJP3JoDmGyeeNnc0=,f4553c8809a6764cefac8eefce9a868a42ee7538bdef4eadfcc06075b865a087
+github.com/gobuffalo/buffalo-docker,v1.0.7,h1:kj+AfChcev54v4N8N6PzNFWyiVSenzu6djrgxTBvbTk=,d84d8bea93f017e3ff07eddab57e0fd7007cf2516250d6fea86c8811c36cf786
+github.com/gobuffalo/buffalo-plugins,v1.14.1,h1:ZL22sNZif+k/0I9X7LB8cpVMWh7zcVjfpiqxFlH4xSY=,556641c2c1b3a9d679a3fc46727d41da225f33c63cfbf1ff721203b24e0a9b82
+github.com/gobuffalo/buffalo-pop,v1.23.1,h1:AnxJQZu/ZN7HCm3L8YBJoNWc2UiwSe6UHv5S4DfXUDA=,00dea8b0e63d3f4110b8bd9d32c086163229f56845a9f8b221e0093876065a05
+github.com/gobuffalo/clara,v0.9.1,h1:LYjwmKG0VwwW/nOG2f5jNamvAcfdm2Ysokc/eoVhtZ8=,319f607092c02686dfed2eb047d500c332ddd962341012bdcd91202bb46d37a9
+github.com/gobuffalo/depgen,v0.2.0,h1:CYuqsR8sq+L9G9+A6uUcTEuaK8AGenAjtYOm238fN3M=,efb3db0d05f712580bc8d3dce2967bd09d6c90140ac7bca1fbd5c5c4a28e1836
+github.com/gobuffalo/envy,v1.7.1,h1:OQl5ys5MBea7OGCdvPbBJWRgnhC/fGona6QKfvFeau8=,14ac6a5cd617dc05abfcb136586800f05f861d4a03d8fa66819a18c0d9eddeec
+github.com/gobuffalo/events,v1.4.0,h1:Vje/vgTWs+dyhIS0U03oLpvx1SUdAqutv/hDWIz2ErM=,f6d99c722115631805f04fcf22e8edb7a4116bc65d698ac05c58b6a7f768efdc
+github.com/gobuffalo/fizz,v1.9.5,h1:Qh0GkP7MYtJs9RZwBkPJ0CzEXynVowdNfrjg8b+TOxA=,2f645d789550f8f97039e1c4ce3e3f09dfeec28d85c8977c2b20caa06cd75b0c
+github.com/gobuffalo/flect,v0.1.6,h1:D7KWNRFiCknJKA495/e1BO7oxqf8tbieaLv/ehoZ/+g=,a7011c8d3f59bac18512c76de610bf1a1f022a01ac6695e0c5af7498d33be613
+github.com/gobuffalo/genny,v0.4.1,h1:ylgRyFoVGtfq92Ziq0kyi0Sdwh//pqWEwg+vD3eK1ZA=,4ecf29587a8cbe069fc6b298d9a3cb674a8008ca4e08233904a8cba91d1ba21b
+github.com/gobuffalo/gitgen,v0.0.0-20190315122116-cc086187d211,h1:mSVZ4vj4khv+oThUfS+SQU3UuFIZ5Zo6UNcvK8E8Mz8=,c79975f91dd2fd691d70e29678034eb2dc94b5da2f01b0790a919de9d2a632ac
+github.com/gobuffalo/github_flavored_markdown,v1.1.0,h1:8Zzj4fTRl/OP2R7sGerzSf6g2nEJnaBEJe7UAOiEvbQ=,2d73a2baad09dc0d0f0c01549c35e83ab0c18c97f859191e54a632c2fb0eaad2
+github.com/gobuffalo/gogen,v0.2.0,h1:Xx7NCe+/y++eII2aWAFZ09/81MhDCsZwvMzIFJoQRnU=,f60900e595a3779b95b299ca9e74c517523860994a0477b360ac447d3318ccbd
+github.com/gobuffalo/helpers,v0.4.0,h1:DR/iYihrVCXv1cYeIGSK3EZz2CljO+DqDLQPWZAod9c=,17ae2b069c0ca73b11b4ace6793617e0620f8d8ef171b0010b91e243c4a3bbe3
+github.com/gobuffalo/here,v0.2.3,h1:1xamq7i4CKjGgICCXY0qpxPeXGdB8oVNSevkpqwd5X4=,3808d0fbc11c58cfb0e7b430b9fc30024ba3781febe8e2601a8e2b8f76e48c00
+github.com/gobuffalo/httptest,v1.4.0,h1:DaoTl/2iFRTk9Uau6b0Lh644tcbRtBNMHcWg6WhieS8=,9d1b48f3e525ab4661d02b3fac86f89fe27f648b1ff8e607f39a353c60c0f315
+github.com/gobuffalo/licenser,v1.4.0,h1:S8WY0nLT9zkBTjFYcbJ0E9MEK7SgE86aMfjsnuThQjY=,3e126adeb06dcaee29376804b463ed33af2b821579162039e8a16e45d0334cdc
+github.com/gobuffalo/logger,v1.0.1,h1:ZEgyRGgAm4ZAhAO45YXMs5Fp+bzGLESFewzAVBMKuTg=,43510255e52f7472ec17a76847ca42cebab6efe0b573a5dcfd8261e00d86d3b7
+github.com/gobuffalo/makr,v1.2.0,h1:TA6ThoZEcq0F9FCrc/7xS1ycdCIL0K6Ux+5wmwYV7BY=,113259ce8e945acf3dd184534ab6135240fde6b57d5c6ee3787e7c124e313502
+github.com/gobuffalo/mapi,v1.1.0,h1:VEhxtd2aoPXFqVmliLXGSmqPh541OprxYYZFwgNcjn4=,162640cc01d04543030d55ed51841d673cb8257fd78b069a79010e52ec996b73
+github.com/gobuffalo/meta,v0.2.0,h1:QSDlR2nbGewl0OVL9kqtU8SeKq6zSonrKWB6G3EgADs=,6a44e2a02126c65d2e2f09de5f732327001ac05d542abcabb8dc286422469e9a
+github.com/gobuffalo/mw-basicauth,v1.0.7,h1:9zTxCpu0ozzwpwvw5MO31w8nEoySNRNfZwM1YAWfGZs=,da5e2767a9d91e14efb25209c9b9dcf5ad07b551d6d54670c43c6225c8e94084
+github.com/gobuffalo/mw-contenttype,v0.0.0-20190129203934-2554e742333b,h1:6LKJWRvshByPo/dvV4B1E2wvsqXp1uoynVndvuuOZZc=,f9e2f7cce4e88ff8d6f86bc61076179b4f23a85eb5fd0a5f28793ef1e7889fab
+github.com/gobuffalo/mw-csrf,v0.0.0-20190129204204-25460a055517,h1:pOOXwl1xPLLP8oZw3e3t2wwrc/KSzmlRBcaQwGpG9oo=,b47a0879eadba5c6774ad37c66afea4998767d9df1295b7b17f3469282cc92f2
+github.com/gobuffalo/mw-forcessl,v0.0.0-20180802152810-73921ae7a130,h1:v94+IGhlBro0Lz1gOR3lrdAVSZ0mJF2NxsdppKd7FnI=,533187beeb18b977c8436d0a5596c1bd420b30cce55589cb11af592df063470c
+github.com/gobuffalo/mw-i18n,v0.0.0-20190129204410-552713a3ebb4,h1:c1fFPCxA7SozZPqMhpfZoOVa3wUpCl11gyCEZ4nYqUE=,96a1754eff9c9a75c6b48fc3bc9ab102bbf5d23c103b37a82cc88c666c0dbf9b
+github.com/gobuffalo/mw-paramlogger,v0.0.0-20190129202837-395da1998525,h1:2QoD5giw2UrYJu65UKDEo9HFcz9yun387twL2zzn+/Q=,d2e3b1baa234032585cc0e7dc1950681dbc05d960ee958578e470df9fa3b8f18
+github.com/gobuffalo/mw-tokenauth,v0.0.0-20190129201951-95847f29c5c8,h1:dqwRMSzfhe3rL0vMDaRvc2ozLqxapWFBEDH6/f0nQT0=,eb6f82200a81da34baa366475479069f08ed797d5edd4976c9f2af1027d37f1c
+github.com/gobuffalo/nulls,v0.1.0,h1:pR3SDzXyFcQrzyPreZj+OzNHSxI4DphSOFaQuidxrfw=,a77a09fd75234e7e5589640fae5d261c03ede9ab5ec626406f24c89dfeba2b38
+github.com/gobuffalo/packd,v0.3.0,h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4=,c7a9263fd464b9f5629bf161521f420b2c40f7780ed6a9ce88184dc4136787a5
+github.com/gobuffalo/packr,v1.30.1,h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg=,20aeea726f6db2ffc8b6dd90b1dce8991f0fd66152a270efdd21c0905b12d5f5
+github.com/gobuffalo/packr/v2,v2.7.1,h1:n3CIW5T17T8v4GGK5sWXLVWJhCz7b5aNLSxW6gYim4o=,60cd83772938a617b37c26a4924ee1f95008d53481724f801eee647e68ce22b1
+github.com/gobuffalo/plush,v3.8.3+incompatible,h1:kzvUTnFPhwyfPEsx7U7LI05/IIslZVGnAlMA1heWub8=,312e219c9827bb7d2dfc954f03fcaa275a3d9eb70687a62ecebad84ede4c51a7
+github.com/gobuffalo/plushgen,v0.1.2,h1:s4yAgNdfNMyMQ7o+Is4f1VlH2L1tKosT+m7BF28C8H4=,0efa90fac0c464409201fa74cace63c4307ac3700a23b3df7c9a9c1c976f0875
+github.com/gobuffalo/pop,v4.12.2+incompatible,h1:WFHMzzHbVLulZnEium1VlYRnWkzHz39FzVLov6rZdDI=,de2837b63e54b15d99234202839e0394183c4ff7c45b9d99162a407c95574003
+github.com/gobuffalo/release,v1.14.0,h1:+Jy7eLN5md6Fg+AMuFRUiK4sTNq4+zXxRho7/wJe1HU=,a0f34f0d3f02ea43434436936766f185b97204a073a605e720190c433c30aaa5
+github.com/gobuffalo/shoulders,v1.2.0,h1:XcPmWbzN7944VXS/I//R7o2eupUHEp3mLFWbUlk1Sco=,4c129ae195bd14520a38c608ba3a27aca674745c1f79fbcce03dacf829802ac6
+github.com/gobuffalo/syncx,v0.0.0-20190224160051-33c29581e754,h1:tpom+2CJmpzAWj5/VEHync2rJGi+epHNIeRSWjzGA+4=,ad9a571b43d72ecce24b8bed85636091710f22d8b06051e1e19ef2051f3e00da
+github.com/gobuffalo/tags,v2.1.6+incompatible,h1:xaWOM48Xz8lBh+C8l5R7vSmLAZJK4KeWcLo+0pJ516g=,99bd74d4144bcdfba45fa501cd8d6dec78dc5b0404bbbfebf5bced5b976bb911
+github.com/gobuffalo/uuid,v2.0.5+incompatible,h1:c5uWRuEnYggYCrT9AJm0U2v1QTG7OVDAvxhj8tIV5Gc=,6ab82616cbb02ddd78b9b7db14f580e2e212ceeadcfccff387a973b04be8db37
+github.com/gobuffalo/validate,v2.0.3+incompatible,h1:6f4JCEz11Zi6iIlexMv7Jz10RBPvgI795AOaubtCwTE=,53d876ba454e5e0604ab8078bfb1fca54dcd3ddd859c850cafce757c5f40153d
+github.com/gobuffalo/x,v0.0.0-20190224155809-6bb134105960,h1:DoUD23uwnzKJ3t5HH2SeTIszWmc13AV9TAdMhtXQts8=,2435ac54f3ea5c024aea1d4db42a87011bb877f18f0f273f7b3e19b7093c3cfd
+github.com/gobwas/glob,v0.2.3,h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=,0cfe486cd63d45ed4cb5863ff1cbd14b15e4b9380dcbf80ff26991b4049f4fdf
+github.com/gobwas/httphead,v0.0.0-20180130184737-2c6c146eadee,h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=,5a43ed4a7cd2b063b634f0df5311c0dfa6576683bfc1339f2c5b1b1127fc392b
+github.com/gobwas/pool,v0.2.0,h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=,52604b1456b92bb310461167a3e6515562f0f4214f01ed6440e3105f78be188f
+github.com/gobwas/ws,v1.0.2,h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=,f9e5c26e83278f19958c68be7b76ad6711c806b6dae766fad7692d2af867bedd
+github.com/gocolly/colly,v1.2.0,h1:qRz9YAn8FIH0qzgNUw+HT9UN7wm1oF9OBAilwEWpyrI=,82f210242c4efda461bb6d2cd0543bbadf322c23b840043f236dc1fd74af9325
+github.com/gocql/gocql,v0.0.0-20191018090344-07ace3bab0f8,h1:ZyxBBeTImqFLu9mLtQUnXrO8K/SryXE/xjG/ygl0DxQ=,d38e5bd51d411bc942f295950d87d80e607a8eb186d51b445cc6c2b985681b18
+github.com/godbus/dbus,v4.1.0+incompatible,h1:WqqLRTsQic3apZUK9qC5sGNfXthmPXzUZ7nQPrNITa4=,107ef979cca9f2720633f118263afeb9acb0bf0703cc1e860098d5ec48efccb8
+github.com/gofrs/flock,v0.7.1,h1:DP+LD/t0njgoPBvT5MJLeliUIVQR03hiKR6vezdwHlc=,ee433032ec18df1e38d2385d7f9448820c5a017d895cb930cd8801401940137c
+github.com/gofrs/uuid,v3.2.0+incompatible,h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE=,4139fd148a7a9389629659253722b302791146583e0db94e351a325ecd06abbf
+github.com/gogf/gf,v1.9.10,h1:lPBf0EOxv6AXVWN46EKLID0GMHDGOrs4ZAi/RUJbt+c=,83a8cf0cc2557c1e1b3cdb2112953ca303a09cb6d457d2102b3921db1bfd6fe5
+github.com/gogits/chardet,v0.0.0-20150115103509-2404f7772561,h1:deE7ritpK04PgtpyVOS2TYcQEld9qLCD5b5EbVNOuLA=,4b5c6d4b26d381d37b9a5538b9f2dc29d11f422653b19a2047e439a268c3f5ba
+github.com/gogits/cron,v0.0.0-20160810035002-7f3990acf183,h1:EBTlva3AOSb80G3JSwY6ZMdILEZJ1JKuewrbqrNjWuE=,746b3b98243fc5ae7127c5102f9ba4f0b88238d081e9cb113d61be2ec16a6241
+github.com/gogo/googleapis,v1.3.0,h1:M695OaDJ5ipWvDPcoAg/YL9c3uORAegkEfBqTQF/fTQ=,ee9e1dda02a5a415c41b5bdff7f6835e929ea89ff3dc1c766510ee909e03c6c3
+github.com/gogo/protobuf,v1.3.1,h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=,4b63e18981e30565f60b7305e3de71ff9aa42cfccf15b88b3813dd2ba6c27be1
+github.com/gogs/chardet,v0.0.0-20150115103509-2404f7772561,h1:aBzukfDxQlCTVS0NBUjI5YA3iVeaZ9Tb5PxNrrIP1xs=,53b6234983c0828d620ba418be5b4e467ef8c9d634bb3d0a2bd4056e3dfa38b3
+github.com/gogs/cron,v0.0.0-20171120032916-9f6c956d3e14,h1:yXtpJr/LV6PFu4nTLgfjQdcMdzjbqqXMEnHfq0Or6p8=,913889f3018853808015c9198e6d3a25f586d88d88493c3de36530eef967664c
+github.com/gogs/git-module,v0.8.2,h1:fCi0Lt8VZuFgjCXeLpkhC3irKLArK4oZ69gFvrDXx/s=,e4010dd8fdfe88a65fa8af6ecf97d7e16d4235d0eeb6a0b4b1f4e4d201c70d23
+github.com/gogs/go-gogs-client,v0.0.0-20190710002546-4c3c18947c15,h1:tgEyCCe4+o8A2K/PEi9lF0QMA6XK+Y/j/WN01LnNbbo=,cc5dcea1cca3d3d3e90a0ad548a660250b1299a61519f6dda5dcd7f2f1412daf
+github.com/gogs/go-libravatar,v0.0.0-20161120025154-cd1abbd55d09,h1:UdOSIHZpkYcajRbfebBYzFDsL3SuqObH3bvKYBqgKmI=,f81991af4a649aa273bc0c3e7251f107ba0967f5d83553f5a18ed688d937eff0
+github.com/gogs/gogs,v0.11.91,h1:p8kTD9Sn6a/14u6ain6j0dPENMZ0gVEiM7phSIAL29E=,b41695c115f4e2dfc96bfbc7443fa6f91a6d2c8b32d32db4262e6977f5d55fa7
+github.com/gogs/minwinsvc,v0.0.0-20170301035411-95be6356811a,h1:8DZwxETOVWIinYxDK+i6L+rMb7eGATGaakD6ZucfHVk=,fb48a56a9f610b061af186008072fbd6e51055a12c168e1e347ecf9a05f25767
+github.com/gohugoio/hugo,v0.59.1,h1:nxaeKEY52cdpx3wZN/EcY6dEqbgeFsZaeNkDL8azeZ8=,508257b11bfc1ec77d3993a13929de63fa08e70ae26cd7c53f03857b3db9bbdf
+github.com/gohugoio/testmodBuilder/mods,v0.0.0-20190520184928-c56af20f2e95,h1:sgew0XCnZwnzpWxTt3V8LLiCO7OQi3C6dycaE67wfkU=,0d6eabbeb381b08c84e7191fcecc49027ad3382997441180b2d6eea3fafc81b6
+github.com/goji/httpauth,v0.0.0-20160601135302-2da839ab0f4d,h1:lBXNCxVENCipq4D1Is42JVOP4eQjlB8TQ6H69Yx5J9Q=,8467ed1df8ffba8da7ead144b656b6281469ab4d122adf3edf496175ad870192
+github.com/goki/freetype,v0.0.0-20181231101311-fa8a33aabaff,h1:W71vTCKoxtdXgnm1ECDFkfQnpdqAO00zzGXLA5yaEX8=,80884151cd73d38904e4370afba3b870345a883a77c395194582202d805d7d74
+github.com/goki/ki,v0.9.8,h1:SzVTxJrd0ZcnkRTinZdbc41nIFmocJ7pyllEyBzNmys=,ce62e162090d566e2f9cb5b1659327a84c646dced32729e24b420cde4d5cb714
+github.com/goki/prof,v0.0.0-20180502205428-54bc71b5d09b,h1:3zU6niF8uvEaNtRBhOkmgbE/Fx7D6xuALotArTpycNc=,f46b93b6c42a97f06a2f658e49243972f4bd469b296f1010609c8d649163b73f
+github.com/golang-collections/collections,v0.0.0-20130729185459-604e922904d3,h1:zN2lZNZRflqFyxVaTIU61KNKQ9C0055u9CAfpmqUvo4=,7847b09c355215616db6309597757ff6be2cf44781d800cdad1628f141dc82ee
+github.com/golang-migrate/migrate/v3,v3.5.2,h1:SUWSv6PD8Lr2TGx1lmVW7W2lRoQiVny3stM4He6jczQ=,5086537ee116e958cf9647e28f843a0ac17f5de75ab642e5aef1fe2b360b0e30
+github.com/golang-sql/civil,v0.0.0-20190719163853-cb61b32ac6fe,h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=,22fcd1e01cabf6ec75c6b6c8e443de029611c9dd5cc4673818d52dac465ac688
+github.com/golang/freetype,v0.0.0-20170609003504-e2365dfdc4a0,h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=,cdcb9e6a14933dcbf167b44dcd5083fc6a2e52c4fae8fb79747c691efeb7d84e
+github.com/golang/gddo,v0.0.0-20180828051604-96d2a289f41e,h1:8sV50nrSGwclVxkCGHxgWfJhY6cyXS2plGjGvUzrMIw=,9a0683005c7700bb1b7ac155597592d15d02f510a0d2c334f8564c43b9072107
+github.com/golang/glog,v0.0.0-20160126235308-23def4e6c14b,h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=,36b3c522c8102dfe74ca96e474c4c361750bf2bb85bc3cefe4f074c07d6825a9
+github.com/golang/groupcache,v0.0.0-20191027212112-611e8accdfc9,h1:uHTyIjqVhYRhLbJ8nIiOJHkEZZ+5YoOsAbD3sk82NiE=,a4815d7048e9a1dd79a72a09d4c9a946ccff837695d046c7f0f5c24037ce18b3
+github.com/golang/lint,v0.0.0-20180702182130-06c8688daad7,h1:2hRPrmiwPrp3fQX967rNJIhQPtiGXdlQWAxKbKw3VHA=,66e95adf2c1feb4de316d2c0ba9e04a22322df010a67b1054ad3d4fb2f9a1791
+github.com/golang/mock,v1.3.1,h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s=,3209f2030646855a3644736b5d7ce2cd9076856cac2f50360805a19c38b7bc45
+github.com/golang/protobuf,v1.3.2,h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=,a004ba3acb85e012cb9e468e1d445a81cfeeb4b4db7e9802f30aa500a8341851
+github.com/golang/snappy,v0.0.1,h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=,0a9a73d55340a8e6d17e72684cf90618b275b6034ce83299abb55ed8fb3860bd
+github.com/golangplus/bytes,v0.0.0-20160111154220-45c989fe5450,h1:7xqw01UYS+KCI25bMrPxwNYkSns2Db1ziQPpVq99FpE=,2904c49772d1bade7c81ddae2fa70e42bdce7b006c871c8106d1feb14fe2982b
+github.com/golangplus/fmt,v0.0.0-20150411045040-2a5d6d7d2995,h1:f5gsjBiF9tRRVomCvrkGMMWI8W1f2OBFar2c5oakAP0=,2afd341a4d32c84532d6d44574718e1b8000aa57cfc21ced284612fc92b61217
+github.com/golangplus/testing,v0.0.0-20180327235837-af21d9c3145e,h1:KhcknUwkWHKZPbFy2P7jH5LKJ3La+0ZeknkkmrSgqb0=,fc111aa59d03741dad00f05ce869fcb44f5d75b841413e21e7301bc538a0255e
+github.com/gomodule/redigo,v2.0.0+incompatible,h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=,77342da7b962489363b3661803ee2fba72b23b8e97af0241877ce6ab8a95d194
+github.com/gonum/blas,v0.0.0-20181208220705-f22b278b28ac,h1:Q0Jsdxl5jbxouNs1TQYt0gxesYMU4VXRbsTlgDloZ50=,bfcad082317ace0d0bdc0832f0835d95aaa90f91cf3fce5d2d81ccdd70c38620
+github.com/gonum/floats,v0.0.0-20181209220543-c233463c7e82,h1:EvokxLQsaaQjcWVWSV38221VAK7qc2zhaO17bKys/18=,52afb5e33a03b027f8f451e23618c2decbe4443f996a203e332858c1a348a627
+github.com/gonum/graph,v0.0.0-20190426092945-678096d81a4b,h1:LilU5ERRFWL+2D6yR1PL2oeS4n+xyTq1vfv39LFVaeE=,411fd86d898ad7ea8c1145610a27f0f13153c86b3ef5e78cb80431125082b5a6
+github.com/gonum/internal,v0.0.0-20181124074243-f884aa714029,h1:8jtTdc+Nfj9AR+0soOeia9UZSvYBvETVHZrugUowJ7M=,e7f40a97eee3574c826a1e75f80ecd94c27853feaab5c43fde7dd95ba516c9dc
+github.com/gonum/lapack,v0.0.0-20181123203213-e4cdc5a0bff9,h1:7qnwS9+oeSiOIsiUMajT+0R7HR6hw5NegnKPmn/94oI=,f38b72e072728121b9acf5ae26d947aacc0024dddc09d19e382bacd8669f5997
+github.com/gonum/matrix,v0.0.0-20181209220409-c518dec07be9,h1:V2IgdyerlBa/MxaEFRbV5juy/C3MGdj4ePi+g6ePIp4=,9cea355e35e3f5718b2c69f65712b2c08a1bec13b3cfadf168d98b41b043dd63
+github.com/google/btree,v1.0.0,h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=,8dbcb36f92c7a6dc5f6aef5c26358d98b72caee69829b5b33dddabada2047785
+github.com/google/cadvisor,v0.34.0,h1:No7G6U/TasplR9uNqyc5Jj0Bet5VSYsK5xLygOf4pUw=,5a3807f43a14e6a03b7ceb9ea11f8ac241a42286be90c3b2cba49ee811111848
+github.com/google/certificate-transparency-go,v1.0.21,h1:Yf1aXowfZ2nuboBsg7iYGLmwsOARdV86pfH3g95wXmE=,7ddb21b272632236d5fb35b35c837f39d38390ea8dcb97c9f0f5d5aa561c3366
+github.com/google/flatbuffers,v1.11.0,h1:O7CEyB8Cb3/DmtxODGtLHcEvpr81Jm5qLg/hsHnxA2A=,ff61e5077ecc7d46a2020c1b42e0a6405b50271f396d4dcc50c683345059af76
+github.com/google/go-cmp,v0.3.2-0.20191028172631-481baca67f93,h1:VvBteXw2zOXEgm0o3PgONTWf+bhUGsCaiNn3pbkU9LA=,6682f890f076aaa03f2c2afb6bc7304c9d602b9e23ff212f8a9a64f44f432dbc
+github.com/google/go-containerregistry,v0.0.0-20191029173801-50b26ee28691,h1:9fkqC5Bq8l2FQgcW6FQbPDUeZvExyg7okl+s4Gg9Jrs=,7bef2c87f7ca8a39e04c770b38160dd5cfdd508546f96fab427225d12d40d85a
+github.com/google/go-github,v17.0.0+incompatible,h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=,9831222a466bec73a21627e0c3525da9cadd969468e31d10ecae8580b0568d0e
+github.com/google/go-github/v21,v21.0.0,h1:tn4/tmCgPAsezJFwZcMnE7U0R9/AtKRBGX4s4LFdDzI=,0b25aebca5386cdb52515402b81a8e0a676ac30f9843feb0a47a1944b7c8b527
+github.com/google/go-github/v24,v24.0.1,h1:KCt1LjMJEey1qvPXxa9SjaWxwTsCWSq6p2Ju57UR4Q4=,4dd0a57a527a1cc52e6619e9d2e1936534439426f0eb065bfbe1e7c03b60d465
+github.com/google/go-github/v28,v28.1.1,h1:kORf5ekX5qwXO2mGzXXOjMe/g6ap8ahVe0sBEulhSxo=,621cca7f4889897317c18ed021fe0f55c279769f11357d90eb21a29c5ea78d04
+github.com/google/go-querystring,v1.0.0,h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=,1c0a0b81b921ee270e47e05cf0bf8df4475de850671e553c07740849068d4f9f
+github.com/google/go-replayers/grpcreplay,v0.1.0,h1:eNb1y9rZFmY4ax45uEEECSa8fsxGRU+8Bil52ASAwic=,794ad7fb2669ea1d1305cf7717a1329146635637739bf2e26d858a318e87f99b
+github.com/google/go-replayers/httpreplay,v0.1.0,h1:AX7FUb4BjrrzNvblr/OlgwrmFiep6soj5K2QSDW7BGk=,cf6d3e2262e94db5bad86d944f2f97507b1ffc2943e4385f140eb6f9a01f8e7b
+github.com/google/go-tpm,v0.2.0,h1:3Z5ZjNRQ0CsUj3yWXtbbx4Vfb/sQapdSeZJvuaKuQzc=,7e90cb155fa3e7759caa1fe5df1ca43520a7f8e1a31e540573cc8290ff523a23
+github.com/google/go-tpm-tools,v0.0.0-20190906225433-1614c142f845,h1:2WNNKKRI+a5OZi5xiJVfDoOiUyfK/BU1D4w+N6967F4=,2e41ca1e24a1ba5eedf980331527d6a5ad09b8ef653bbd040321572899eff8a2
+github.com/google/gofuzz,v1.0.0,h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=,752570262575bbcb5f0107dbd80a463abacaf51e94e15f96f5bc4166ff2d33e1
+github.com/google/gopacket,v1.1.17,h1:rMrlX2ZY2UbvT+sdz3+6J+pp2z+msCq9MxTU6ymxbBY=,008645038244e12a1bfbda2317372ec34a514250741139b8e4842de7f98639d4
+github.com/google/gxui,v0.0.0-20151028112939-f85e0a97b3a4,h1:OL2d27ueTKnlQJoqLW2fc9pWYulFnJYLWzomGV7HqZo=,be209ad45b16077b010faef4a7bcbf0723dfbe47869a6f4c0aacd534e7fcbfb1
+github.com/google/martian,v2.1.1-0.20190517191504-25dcb96d9e51+incompatible,h1:xmapqc1AyLoB+ddYT6r04bD9lIjlOqGaREovi0SzFaE=,dfc5eac3877863c1f231457f96c54c915ea1c86f86c590710b7477f96e1ba0f3
+github.com/google/netstack,v0.0.0-20191031000057-4787376a6744,h1:wKeh74w+ydKcE1Eo44WDzIOcPHWmxxmtAzkAL0Mlspc=,dd74d0c9fadfb29db3bd09da657cb95300255d562ce596e88c865a71ee5d2519
+github.com/google/pprof,v0.0.0-20191028172815-5e965273ee43,h1:59gkLC5pLENSgzw9Gx73BQQho5i//80XwgIIYWxZjp4=,667012da0f67eb7822d16f532e850091a58c1efebeef5047df9a02e972112484
+github.com/google/readahead,v0.0.0-20161222183148-eaceba169032,h1:6Be3nkuJFyRfCgr6qTIzmRp8y9QwDIbqy/nYr9WDPos=,3a2435123538463dc3412a2eb1be033b7cf8105775c1ff3524351ec405fa1469
+github.com/google/renameio,v0.1.0,h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA=,b8510bb34078691a20b8e4902d371afe0eb171b2daf953f67cb3960d1926ccf3
+github.com/google/rpmpack,v0.0.0-20191101142923-13d81472ccfe,h1:P1WflKHEgTAYe39btxYzeds84DhxQSLj4hfoNn0tCyQ=,5144bdeda051f10f407f1f798502ec0d7599f9c4a7e0a79c3711fe2b79f5cae4
+github.com/google/shlex,v0.0.0-20181106134648-c34317bd91bf,h1:7+FW5aGwISbqUtkfmIpZJGRgNFg2ioYPvFaUxdqpDsg=,250fc48c105475c54cc8c9fe5c110e31986590433de2608740d6592d0dc0a4c6
+github.com/google/subcommands,v1.0.1,h1:/eqq+otEXm5vhfBrbREPCSVQbvofip6kIz+mX5TUH7k=,de4249d9823a0509df32ebad2787d5e54c9b53c1059592bd9a3bb0c4cf58034d
+github.com/google/uuid,v1.1.1,h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=,2b0cbc45fb0e21c8bfebbae9b04babc196d9f06d9f3b9dec5e2adc8cfd0c1b81
+github.com/google/wire,v0.3.0,h1:imGQZGEVEHpje5056+K+cgdO72p0LQv2xIIFXNGUf60=,38eb402dbe84aee2f891df0e62623f9ff5615dfeb1e4f631eaac5cf1859c9ea6
+github.com/googleapis/gax-go,v2.0.2+incompatible,h1:silFMLAnr330+NRuag/VjIGF7TLp/LBrV2CJKFLWEww=,36fe8c993c8f90067bffbba78f1325ff45ae60c8a85b778d798c56067e55c19e
+github.com/googleapis/gax-go/v2,v2.0.5,h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=,846b017e21fc01f408774051d4a10bfccd7c294e10a1ad5d725278889d5f1d42
+github.com/googleapis/gnostic,v0.3.1,h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk=,33277bd9aab84cf04d058a5e2e1dbb5f3c023ba30c6127b4cc8a6662a776de53
+github.com/gopackage/ddp,v0.0.0-20170117053602-652027933df4,h1:4EZlYQIiyecYJlUbVkFXCXHz1QPhVXcHnQKAzBTPfQo=,76b2493aae8a5513b707e4f6c529f57175cca6c834dd19072a51ed3974cd77bc
+github.com/gophercloud/gophercloud,v0.6.0,h1:Xb2lcqZtml1XjgYZxbeayEemq7ASbeTp09m36gQFpEU=,f5be75a3b128c9de7385dd7e2a8ec9fba18fb46dcf57624d88249ae99e188ed2
+github.com/gophercloud/utils,v0.0.0-20190128072930-fbb6ab446f01,h1:OgCNGSnEalfkRpn//WGJHhpo7fkP+LhTpvEITZ7CkK4=,c98b6d529b47679302d175f04d7b635824c292edc8a5ede807f9ba8145517ce7
+github.com/gopherjs/gopherjs,v0.0.0-20190915194858-d3ddacdb130f,h1:TyqzGm2z1h3AGhjOoRYyeLcW4WlW81MDQkWa+rx/000=,ff395ad20350783713974a6b4d03254b811d83c0c0caa13bcb329462a7263f70
+github.com/gopherjs/jquery,v0.0.0-20180404123100-3ba2b901425e,h1:Tf0PnEo36tq56/JezxbbiFpEce0pmK6tY7hS6PNS7tI=,26fb481ef7f7010ec901990527d7ef7b06bc18c38cb617db77f8b61263b5b453
+github.com/gopherjs/jsbuiltin,v0.0.0-20180426082241-50091555e127,h1:atBEgNR1C5+LFkl8ipQtLee9RStheS8YeCSkiYqBhOg=,603151a77e4be25c8389014b06449520c2ad5856f0161590a5de5f01bee28912
+github.com/goreleaser/goreleaser,v0.120.5,h1:N3VirNAK9u30Wj7xulfE9/cCvptO0vl+CLhaMEVGbGs=,9c516d6e8db8c6800102ca68e3f674a62dd42877d7785607f56c22f6dc9b5a9e
+github.com/goreleaser/nfpm,v1.1.2,h1:9+hnNm/h/ANQWLxZixNO562w4tIO/8VlgCwOKwwZTX4=,9781a05527458d352a744a524c94473d2a72694fd54bc559a5888158bb4fa1fb
+github.com/gorhill/cronexpr,v0.0.0-20180427100037-88b0669f7d75,h1:f0n1xnMSmBLzVfsMMvriDyA75NB/oBgILX2GcHXIQzY=,742d8957d3f9fe773150fb3164868a755b2af5b705b38c72c45ca5386715c617
+github.com/gorilla/context,v1.1.1,h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8=,4ec8e01fe741a931edeebdee9348ffb49b5cc565ca245551d0d20b67062e6f0b
+github.com/gorilla/csrf,v1.6.0,h1:60oN1cFdncCE8tjwQ3QEkFND5k37lQPcRjnlvm7CIJ0=,6fa6b9d34ba1c2409e6575db396f57607c5283e397d38a271b6930c666f166b0
+github.com/gorilla/handlers,v1.4.2,h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg=,9e47491112a46d32e372be827899e8678a881f6407f290564c63e8725b5e9a19
+github.com/gorilla/mux,v1.7.3,h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=,9ffc6c6c1194cb2b9f39237ff90b20eb4a55273404c97364ed9a6500e9571fe3
+github.com/gorilla/pat,v1.0.1,h1:OeSoj6sffw4/majibAY2BAUsXjNP7fEE+w30KickaL4=,e0dedacf6f405854b94932a59b410bbda64d4fff8111b674db987ce242bc9d57
+github.com/gorilla/rpc,v1.1.0,h1:marKfvVP0Gpd/jHlVBKCQ8RAoUPdX7K1Nuh6l1BNh7A=,0e83ae0cbc4164cdaf0b808413f97fed7a90e2096095c14f5495b6dbfaa34266
+github.com/gorilla/schema,v1.1.0,h1:CamqUDOFUBqzrvxuz2vEwo8+SUdwsluFh7IlzJh30LY=,42a6d7dc873e8ba1822551b4e15304d5654a11f6da3cccdc270be847148bbfaf
+github.com/gorilla/securecookie,v1.1.1,h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=,dd83a4230e11568159756bbea4d343c88df0cd1415bbbc7cd5badad6cd2ed903
+github.com/gorilla/sessions,v1.2.0,h1:S7P+1Hm5V/AT9cjEcUD5uDaQSX0OE577aCXgoaKpYbQ=,8753d00ae6cf8ea0e28c195d4b87875384e2ed79df7eba4cf210fdf9ab0294df
+github.com/gorilla/websocket,v1.4.1,h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=,86eb427567de9e2dc84da52ee4f4315496c5ffc2152928df0e3ac4ce8a359ff7
+github.com/gosimple/slug,v1.9.0,h1:r5vDcYrFz9BmfIAMC829un9hq7hKM4cHUrsv36LbEqs=,0f72d897e3decea434cdc68c7d0226afbda7d6b1908e955bf406333e7d6bb4a7
+github.com/gosuri/uitable,v0.0.3,h1:9ZY4qCODg6JL1Ui4dL9LqCF4ghWnAOSV2h7xG98SkHE=,1316f88b6b2689d941a4727889818705a289c72d7f1f4d2d9cf5cd06fecd0b7b
+github.com/gotestyourself/gotestyourself,v2.2.0+incompatible,h1:AQwinXlbQR2HvPjQZOmDhRqsv5mZf+Jb1RnSLxcqZcI=,653f8ec3ed62f8d235ab67cfc56e7c814d4ac6f56f24000802b32728523c074c
+github.com/gotnospirit/makeplural,v0.0.0-20180622080156-a5f48d94d976,h1:b70jEaX2iaJSPZULSUxKtm73LBfsCrMsIlYCUgNGSIs=,5750c916115b851f4881b76d90128802d090558958aa821c691d4fa378018093
+github.com/gotnospirit/messageformat,v0.0.0-20180622080451-0eab1176a3fb,h1:akgcoKcMcMOlzb6fdycEck1Vc3+y7ubUjO6hgAOyqC8=,7189231c806aa1988b50a82019c5f972a5f1b82e61c94776999728ec1894cd29
+github.com/graarh/golang-socketio,v0.0.0-20170510162725-2c44953b9b5f,h1:utzdm9zUvVWGRtIpkdE4+36n+Gv60kNb7mFvgGxLElY=,f41faefdf625d1c04113636d467a9fa47fe083148d7393fa65c0f08e3a4078c3
+github.com/grafana/globalconf,v0.0.0-20181214112547-7a1aae0695d9,h1:2/Bz5A5zR4TMGd9yvgGMal7nhQwHBt5/dfp0sbJFfes=,0393f4fa690096ea26c76373e99f9d9f3bfc9b34e5acd08d639b68f68af7b5e2
+github.com/grandcat/zeroconf,v0.0.0-20190424104450-85eadb44205c,h1:svzQzfVE9t7Y1CGULS5PsMWs4/H4Au/ZTJzU/0CKgqc=,2d364bea1939e3ec55b732cae452feb3182fc1d8ffa30f35aa42c0181709d138
+github.com/graph-gophers/graphql-go,v0.0.0-20190225005345-3e8838d4614c,h1:YyFUsspLqAt3noyPCLz7EFK/o1LpC1j/6MjU0bSVOQ4=,fad60e1061e15848aff79c6620f1cf55a9dd87d58ca2f57fea50c35322c817ac
+github.com/graphql-go/graphql,v0.7.9-0.20190403165646-199d20bbfed7,h1:E45QFM7IqRdFnuyFk8GSamb42EckUSyJ55rtVB/w8VQ=,6e9d51c4dc431d2d7c1348fa2b3358ed8e57338a07750177698bde29c913e786
+github.com/gravitational/trace,v0.0.0-20190726142706-a535a178675f,h1:68WxnfBzJRYktZ30fmIjGQ74RsXYLoeH2/NITPktTMY=,6fb8317692ac3aa8280cd4b4749970ec6652ecbe2c629cd43b52005f9a992197
+github.com/graymeta/stow,v0.2.4,h1:qDGstknYXqcnmBQ5TRJtxD9Qv1MuRbYRhLoSMeUDs7U=,67b4e728448b89c2233da14c22f18fe6c720e88a858dff2cd3c7405c7ea10493
+github.com/gregjones/httpcache,v0.0.0-20190611155906-901d90724c79,h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA=,73d773791d582cad0d90942e7d92f52d82f13119dd78e849bbd77fae2acc0276
+github.com/grokify/html-strip-tags-go,v0.0.0-20190921062105-daaa06bf1aaf,h1:wIOAyJMMen0ELGiFzlmqxdcV1yGbkyHBAB6PolcNbLA=,0bb5eaff16e4119a9251bb0a26b4190a8e36cbacce8daee8c77df76022e1087c
+github.com/grpc-ecosystem/go-grpc-middleware,v1.1.0,h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg=,def2c3ec1d07264489b79fa0e8e7a5c23545f16ba3c6e613f5cdba2ae8fe2768
+github.com/grpc-ecosystem/go-grpc-prometheus,v1.2.1-0.20191002090509-6af20e3a5340,h1:uGoIog/wiQHI9GAxXO5TJbT0wWKH3O9HhOJW1F9c3fY=,bca256c9eee3d43fe310c205866c69de454e71346f18ea2b05a32bd2f6018c84
+github.com/grpc-ecosystem/grpc-gateway,v1.11.3,h1:h8+NsYENhxNTuq+dobk3+ODoJtwY4Fu0WQXsxJfL8aM=,d96a88c820576b8b6989944cbe15f4f2d94d2884f29f2f683b975a03a5bdc5fc
+github.com/grpc-ecosystem/grpc-opentracing,v0.0.0-20180507213350-8e809c8a8645,h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU=,0606bde24e978e9cd91ae45ca9e5222ce695c21a07ae02e77546496bf23b1c62
+github.com/gucumber/gucumber,v0.0.0-20180127021336-7d5c79e832a2,h1:iR8wSrr/JCzL1Ul+dRVxtIOnP8DGg/m02nHZJ9PH6P0=,4feb5116e650552868f056ee74d179e91239bf166d365267f32e903ccc495dbb
+github.com/guptarohit/asciigraph,v0.4.1,h1:YHmCMN8VH81BIUIgTg2Fs3B52QDxNZw2RQ6j5pGoSxo=,976279cdbc5425609c272b2116a92fb5871a40164ae64c51dedffea7b550d2d4
+github.com/guregu/null,v2.1.3-0.20151024101046-79c5bd36b615+incompatible,h1:SZmF1M6CdAm4MmTPYYTG+x9EC8D3FOxUq9S4D37irQg=,1adcbf87f6c55963b0d020ccbac0ebd07e8aca5e0ff22469ac708c6574d7333f
+github.com/gxed/go-shellwords,v1.0.3,h1:2TP32H4TAklZUdz84oj95BJhVnIrRasyx2j1cqH5K38=,c63674c66949c0442402bceca8b7768684875a667140ea0b32afdd46fc094a7f
+github.com/gxed/hashland/keccakpg,v0.0.1,h1:wrk3uMNaMxbXiHibbPO4S0ymqJMm41WiudyFSs7UnsU=,c77522ff0820feb7b5be4e1c74d7c64b3aa5afe3452e1dd2f54d1ffa067c6b2d
+github.com/gxed/hashland/murmur3,v0.0.1,h1:SheiaIt0sda5K+8FLz952/1iWS9zrnKsEJaOJu4ZbSc=,4576d7ae9b5d2f4ebd238de84f3b52b9d4ae4d41822ac0eabd404d346eace067
+github.com/gxed/pubsub,v0.0.0-20180201040156-26ebdf44f824,h1:TF4mX7zXpeyz/xintezebSa7ZDxAGBnqDwcoobvaz2o=,718b183cca4e30a97d3fa06457060b4d3be66742838d98a39b02ea710693d9eb
+github.com/h2non/filetype,v1.0.8,h1:le8gpf+FQA0/DlDABbtisA1KiTS0Xi+YSC/E8yY3Y14=,534a477c811032fceb0c8e1ad7a15f35ff95f1d038d41164bb4d265860cc42c3
+github.com/h2non/gock,v1.0.9,h1:17gCehSo8ZOgEsFKpQgqHiR7VLyjxdAG3lkhVvO9QZU=,ab5679329b0c26b523254dd728cad1b4e6e2e7bf11569df73a1dcaa468a46cd6
+github.com/h2non/parth,v0.0.0-20190131123155-b4df798d6542,h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=,3b7b7e4bb3c2d0e22075e13443af78d03fb2ed54b3eb5bb1fa6f528c7ebe3ac0
+github.com/hailocab/go-hostpool,v0.0.0-20160125115350-e80d13ce29ed,h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8=,faf2b985681cda77ab928976b620b790585e364b6aff351483227d474db85e9a
+github.com/hanwen/go-fuse,v1.0.0,h1:GxS9Zrn6c35/BnfiVsZVWmsG803xwE7eVRDvcf/BEVc=,4b94d038e80959f816a18b34cdcbb5244e87b73956b220aac213483999b54c84
+github.com/hashicorp/aws-sdk-go-base,v0.4.0,h1:zH9hNUdsS+2G0zJaU85ul8D59BGnZBaKM+KMNPAHGwk=,967c057aecede32de140c88b6527149d2441216569620b9d9350522d0f309bdc
+github.com/hashicorp/consul,v1.6.1,h1:ISPgwOO8/vPYrCXQNyx63eJAYjPGRnmFsXK7aj2XICs=,0ca8c5046df99a7a6607ab68b6604340af58d1696c7901088adfd9618850629f
+github.com/hashicorp/consul/api,v1.2.0,h1:oPsuzLp2uk7I7rojPKuncWbZ+m5TMoD4Ivs+2Rkeh4Y=,2833a78c39a4fa869a928e1218f3aa83130e4f5c03b4d4e355fb76b91fa75946
+github.com/hashicorp/consul/sdk,v0.2.0,h1:GWFYFmry/k4b1hEoy7kSkmU8e30GAyI4VZHk0fRxeL4=,3f0b677061f7e79191cc0d2f8184895c20051166959566a2e48e511b1fab222c
+github.com/hashicorp/errwrap,v1.0.0,h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=,ccdf4c90f894d8a5fde4e79d5828c5d27a13e9f7ce3006dd72ce76e6e17cdeb2
+github.com/hashicorp/go-azure-helpers,v0.0.0-20190129193224-166dfd221bb2,h1:VBRx+yPYUZaobnn5ANBcOUf4hhWpTHSQgftG4TcDkhI=,dd17ed56e4b541cffa69679557074071372ab70682f695d8b61126c9393f92dc
+github.com/hashicorp/go-bexpr,v0.1.2,h1:ijMXI4qERbzxbCnkxmfUtwMyjrrk3y+Vt0MxojNCbBs=,ac79086a2900ebf2f5414fe54b5799f24b3ddf953a28299f46831a11b10b1df0
+github.com/hashicorp/go-checkpoint,v0.5.0,h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=,1baf63010271d6c8abc0f4edc9e9d41483cb55218e4e399ca4c70ef225415f36
+github.com/hashicorp/go-cleanhttp,v0.5.1,h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM=,e3cc9964b0bc80c6156d6fb064abcb62ff8c00df8be8009b6f6d3aefc2776a23
+github.com/hashicorp/go-discover,v0.0.0-20190403160810-22221edb15cd,h1:SynRxs8h2h7lLSA5py5a3WWkYpImhREtju0CuRd97wc=,c58ed5375890c98a836234f5166cf88b73ad7595899edaa43c775d650043b4b3
+github.com/hashicorp/go-gcp-common,v0.5.0,h1:kkIQTjNTopn4eXQ1+lCiHYZXUtgIZvbc6YtAQkMnTos=,a1fee55619b3579e5fe89b6f944dce87e190b8ea1526f24622ba5941d664b639
+github.com/hashicorp/go-getter,v1.4.0,h1:ENHNi8494porjD0ZhIrjlAHnveSFhY7hvOJrV/fsKkw=,cbae7b8a5f018c78bb304c47840c390b3c3be98b712b90b33d16304f1b427eb1
+github.com/hashicorp/go-hclog,v0.9.2,h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI=,e1a873d9fa828038b5b2c93e0f49f9e8187b4f5255d0a3d7989d3ac178807af4
+github.com/hashicorp/go-immutable-radix,v1.1.0,h1:vN9wG1D6KG6YHRTWr8512cxGOVgTMEfgEdSj/hr8MPc=,c23ca92f0fb7dce35b86d35ccf9cfa871db97379d2ca8a0fcc15fde32ff369bb
+github.com/hashicorp/go-memdb,v1.0.4,h1:sIdJHAEtV3//iXcUb4LumSQeorYos5V0ptvqvQvFgDA=,c3eedd68e60f3db16499dff27fe4d4e874978c250bab152044965a475cb47c72
+github.com/hashicorp/go-msgpack,v0.5.5,h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI=,fb47605669b0ddd75292aac788208475fecd54e0ea3e9a282d8a98ae8c60d1f5
+github.com/hashicorp/go-multierror,v1.0.0,h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=,a66a1b9dff26a9a7fcaa5aa5e658c13f94c0daeb572536b1ecc7ebe51f4d0be7
+github.com/hashicorp/go-oracle-terraform,v0.0.0-20181016190316-007121241b79,h1:RKu7yAXZTaQsxj1K9GDsh+QVw0+Wu1SWHxtbFN0n+hE=,5b3ab30e1aef56e38d750a5dc344f1ab996859408a6b76a9f48f5f75747fd712
+github.com/hashicorp/go-plugin,v1.0.1,h1:4OtAfUGbnKC6yS48p0CtMX2oFYtzFZVv6rok3cRWgnE=,0853effcccdb7bfac1c122f72cd3a1241b4e0934609541c409e9f59b441ae01e
+github.com/hashicorp/go-raftchunking,v0.6.2,h1:imj6CVkwXj6VzgXZQvzS+fSrkbFCzlJ2t00F3PacnuU=,f5c55a3679c8a8f63d798d2b67552bfcd198dc5b9473d81c3ce1b353a055bc5c
+github.com/hashicorp/go-retryablehttp,v0.6.3,h1:tuulM+WnToeqa05z83YLmKabZxrySOmJAd4mJ+s2Nfg=,69cb67f4821e97ca8f04b0cb710c61a5acfaa948dda59b949b40fd6fae8e7dec
+github.com/hashicorp/go-rootcerts,v1.0.1,h1:DMo4fmknnz0E0evoNYnV48RjWndOsmd6OW+09R3cEP8=,3f558b1a436ed6fb15872383545109227f9552bf5daa95583e9402bbd3a24fff
+github.com/hashicorp/go-safetemp,v1.0.0,h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo=,6843a6b60d650ae9be836add0ab5ac1b1719a101bf12fe4ca6678fcd87baa19a
+github.com/hashicorp/go-slug,v0.4.0,h1:YSz3afoEZZJVVB46NITf0+opd2cHpaYJ1XSojOyP0x8=,b6a027a2d69ae8786a6830239a79ceac487463237b49e03250a9b1e116f0a5ac
+github.com/hashicorp/go-sockaddr,v1.0.2,h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc=,50c1b60863b0cd31d03b26d3975f76cab55466666c067cd1823481a61f19af33
+github.com/hashicorp/go-syslog,v1.0.0,h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE=,a0ca8b61ea365e9ecdca513b94f200aef3ff68b4c95d9dabc88ca25fcb33bce6
+github.com/hashicorp/go-tfe,v0.3.25,h1:4rPk/9rSYuRoujKk5FsxSvtC/AjJCQphLS/57yr6wUM=,5ade1d16517697c7bd04b556f852264eef33906c52d32bd6702c47838c1c1c04
+github.com/hashicorp/go-uuid,v1.0.1,h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=,a05417b988b047d55fca8ad4fec6bde56c3907f679fece48f97d608e61e82a5c
+github.com/hashicorp/go-version,v1.2.0,h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E=,a3231adb6bf029750970de2955e82e41e4c062b94eb73683e9111aa0c0841008
+github.com/hashicorp/go.net,v0.0.1,h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw=,71564aa3cb6e2820ee31e4d9e264e4ed889c7916f958b2f54c6f3004d4fcd8d2
+github.com/hashicorp/golang-lru,v0.5.3,h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk=,ac6e8bdc76a1275e3496f1ab2484e28ab4be2c81e2da78b8cdd1c2d269b931e4
+github.com/hashicorp/hcl,v1.0.0,h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=,54149a2e5121b3e81f961c79210e63d6798eb63de28d2599ee59ade1fa76c82b
+github.com/hashicorp/hcl/v2,v2.0.0,h1:efQznTz+ydmQXq3BOnRa3AXzvCeTq1P4dKj/z5GLlY8=,6275e2af8b3247c6de72baab13b3be531431f695e001e4d36c920e412a715032
+github.com/hashicorp/hcl2,v0.0.0-20191002203319-fb75b3253c80,h1:PFfGModn55JA0oBsvFghhj0v93me+Ctr3uHC/UmFAls=,42811f77c4da1d31371c51076cbcecc99042fc7a74c6e2622b11bea96043a777
+github.com/hashicorp/hil,v0.0.0-20190212112733-ab17b08d6590,h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI=,cb2b110c86a312b7c60094c9b11853ae288945c34fa5861b67ff2d97edaab292
+github.com/hashicorp/logutils,v1.0.0,h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y=,0e88424578d1d6b7793b63d30c180a353ce8041701d25dc7c3bcd9841c36db5b
+github.com/hashicorp/mdns,v1.0.1,h1:XFSOubp8KWB+Jd2PDyaX5xUd5bhSP/+pTDZVDMzZJM8=,0f4b33961638b1273ace80b64c6fc7e54a1064484b2a1e182ab3d38a35dbc94f
+github.com/hashicorp/memberlist,v0.1.5,h1:AYBsgJOW9gab/toO5tEB8lWetVgDKZycqkebJ8xxpqM=,51054573cad1655b1b349553a8d455eedc15b49f0277edd2e693bc5d0503af62
+github.com/hashicorp/net-rpc-msgpackrpc,v0.0.0-20151116020338-a14192a58a69,h1:lc3c72qGlIMDqQpQH82Y4vaglRMMFdJbziYWriR4UcE=,b0c3a5ec955b0dfb85b39a6aa1d10fe0e810dd78493c0a14ea5760bac1cadd32
+github.com/hashicorp/nomad/api,v0.0.0-20190412184103-1c38ced33adf,h1:U/40PQvWkaXCDdK9QHKf1pVDVcA+NIDVbzzonFGkgIA=,b9e994cd47eed80531b93d9f64be426cbdc6fc6e58323f6b26ae53b1fd692bbd
+github.com/hashicorp/packer,v1.4.4,h1:ee+jewbEfTKV77+YtRR0m2Q8suTiXnr010bBFt5vJSA=,d2fc7c22b3528a4acb321fda24575cf2f88df8f5085b3b5da559e44d8b12295a
+github.com/hashicorp/raft,v1.1.1,h1:HJr7UE1x/JrJSc9Oy6aDBHtNHUUBHjcQjTgvUVihoZs=,b6a10aa04b5f45486a6111d4a50cb65ee179b091f04a047e316b85f38ebbf873
+github.com/hashicorp/raft-boltdb,v0.0.0-20191021154308-4207f1bf0617,h1:CJDRE/2tBNFOrcoexD2nvTRbQEox3FDxl4NxIezp1b8=,e2008570aed06ba72cd783d6bc729b67b7e0cecd2219a8420dd24dcef82e64f8
+github.com/hashicorp/raft-snapshot,v1.0.1,h1:cx002JsTEAfAP0pIuANlDtTXg/pi2Db6YbRRmLQTQKw=,3d40d03f6793fe87464359f28b136b920daf7aa8544a98270470d04cef132a77
+github.com/hashicorp/serf,v0.8.5,h1:ZynDUIQiA8usmRgPdGPHFdPnb1wgGI9tK3mO9hcAJjc=,88623d0f1a155bb2fe254210f68f1603b42162f031fbf51256f1465b36bc7769
+github.com/hashicorp/terraform,v0.12.13,h1:LACXUTZvAGf8W/6wehHjOgi6YEMN7ejDUpnpll2qbJ0=,4dbe6d0c15f4d934fd583fc20bec55326ffc79cf0d5b7fd28978ba14d178fe8d
+github.com/hashicorp/terraform-config-inspect,v0.0.0-20190821133035-82a99dc22ef4,h1:fTkL0YwjohGyN7AqsDhz6bwcGBpT+xBqi3Qhpw58Juw=,1261dc9b65805f9be029f6a42d9e0ddccc89c4d0c50e5fa2895b1b53198195c3
+github.com/hashicorp/terraform-svchost,v0.0.0-20191011084731-65d371908596,h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg=,8055e9f82b0484eb70594ca682bcf4401d2286c2021ffc72c6c3b6ad9ac9a024
+github.com/hashicorp/vault,v1.2.0-rc1,h1:GFYP6ck5f0EaJsGMD4PARIX5HaHREUxMbTaVPy+dFEg=,89c84474c97b1400ca858fe1b6e0eb3bd91dac17a4aff4336bd95104381e8b2b
+github.com/hashicorp/vault-plugin-auth-alicloud,v0.5.2-0.20190725165955-db428c1b0976,h1:f+r1gXVvQJ0+2pfxgBDP1zZUC6lUmPNM0xp7AKupyBg=,3bc95606713215c3ae25f9be06ed2186f8f2e5e9ad8e025fafd332d97045ed09
+github.com/hashicorp/vault-plugin-auth-azure,v0.5.2-0.20190725170003-0fc4bd518aa2,h1:Ua6AFhJYkdNGC5s4uDL7EGVBD/jPUOcnubDkPsaG7K8=,bfa988cf4a3e33e7db3caf2ecad55c2f7c2e3f39088243767927ac8ed8d2556e
+github.com/hashicorp/vault-plugin-auth-centrify,v0.5.2-0.20190725170023-9d8d5e0b03e6,h1:UXM3yxzNaruvgaccRjFXKcKnsTTHzp213MJ045wto6A=,165cf5f7daa0e4c286bad12f09eeac648062554399f18890bf35789b6b16e9c7
+github.com/hashicorp/vault-plugin-auth-gcp,v0.5.2-0.20190725170032-0aa7d1c92039,h1:uqYbah1dntV8OccHCbY3bBzYX/zLtjmG0ZIZPV+x6EM=,e9f9ccc7ca02c40291bb27012f2dd1fead86d2de2ab85a6d07b0aa7d98533f49
+github.com/hashicorp/vault-plugin-auth-jwt,v0.5.2-0.20190725170041-1cfee03e8d3a,h1:zdhacnLMH4P47PdSPJo0omNh+IkSvPj0LbiHLQu0aVk=,2b04c80c6d2000558b63ced2c9ba60a4a2ffe4c76d2d58d5fe121f714a3cf291
+github.com/hashicorp/vault-plugin-auth-kubernetes,v0.5.2-0.20190725170047-354505be0ecf,h1:il4UUQC9zfsSRNR2EAQVqC+DzrvzZpFmJReQ7p6/bKw=,d95794ab78e644a95799a3505a83af58a83c6bf775e69832b3660ca47c042d5a
+github.com/hashicorp/vault-plugin-auth-oci,v0.0.0-20190904175623-97c0c0187c5c,h1:z6LQZvs1OtoVy2XgbgNhiDgp0U62Xbstn7/cgNZvh6g=,b23f2afa7fab5368d83a01be865e2dddf7ba6c7e8804ac205ccc1701a9239d51
+github.com/hashicorp/vault-plugin-auth-pcf,v0.0.0-20190725170053-826a135618c1,h1:mPyQ1+jB/ztcqebEdmNhSuYq4XVOpB5TUyyi0118T40=,c444159df670a1aba7e59029bf928989091886fa45970f751fe644d243d43744
+github.com/hashicorp/vault-plugin-database-elasticsearch,v0.0.0-20190725170059-5c0d558eb59d,h1:VUD1T3aI5GL8uoSSDhHncHP8ksgepZsvSLhsRG8MJ3s=,b151c27f632b8e05686473b4936b480cec694498c1e446dc5208b4db05c559f1
+github.com/hashicorp/vault-plugin-secrets-ad,v0.5.3-0.20190725170108-e1b17ad0c772,h1:N219G3MUxPRhtOBMFVdsSQWU47MrvivSHLmTAPpHcs4=,c8801ee5f030fa6cb36045f1e321d964224f9a2b4a17100140cafca7a6d8daf5
+github.com/hashicorp/vault-plugin-secrets-alicloud,v0.5.2-0.20190725170114-7d66a3fa0600,h1:kyHR0JOKFDAaC4sjQ3iD1lTH6uaIfmTk4rQ+JOGW5Zo=,f816c029601c9e7235f798e9591246ac935d3b1e330abfb23af59afa6bc08e0d
+github.com/hashicorp/vault-plugin-secrets-azure,v0.5.2-0.20190725170121-541440395211,h1:hZ21h0DWWKkoeMW7zkYaPVLxGZtKfYyIcE9G8xug4YQ=,5d71ad3ef26fd40b3afaf852913f38e5be0a1db8844bf21cb787e204cdbc48e4
+github.com/hashicorp/vault-plugin-secrets-gcp,v0.5.3-0.20190725170127-aa49df112140,h1:gSvWU9aYAsHxqKU0ohJD9njlNQ1/qLFPRs85u+xJFv4=,9b209e3ef7b8d7c41e823705cc190699540bbd2076f82344a83c106fa7e4ac98
+github.com/hashicorp/vault-plugin-secrets-gcpkms,v0.5.2-0.20190725170135-aaf270943731,h1:zP2vqetYhON59Mf5FTV9KmyKSnY1cLFzdNW0YYnNKbo=,5d3bc6de4bdad4725c4348a0d6861bce3e80a9eb13d4b05179cd663b47f46545
+github.com/hashicorp/vault-plugin-secrets-kv,v0.5.2-0.20190725170141-1c4dac87f383,h1:4IqT7JQt/GyYKr0HGemkUlYpF45ZALHSN9rHy7Sipos=,10f03c6d8a51714692b43ab69c2cb5f041ac611210aa9804237a9345e930f018
+github.com/hashicorp/vault/api,v1.0.4,h1:j08Or/wryXT4AcHj1oCbMd7IijXcKzYUGw59LGu9onU=,a885d16e067a5586e55914cd8e40f250a28fe94b3b864de47d495ad1f71c4251
+github.com/hashicorp/vault/sdk,v0.1.14-0.20190909201848-e0fbf9b652e2,h1:b65cSyZqljnCPzzsUXvR4P0eXypo1xahQyG809+IySk=,0aca8708570b724605514cab6dbbc9cc7bce5d27786a4b2da87553c437c42463
+github.com/hashicorp/vic,v1.5.1-0.20190403131502-bbfe86ec9443,h1:O/pT5C1Q3mVXMyuqg7yuAWUg/jMZR1/0QTzTRdNR6Uw=,9c09a35b14d797812e6714073471b3472c16f9cb4deb430f9e2dd15fa8d25e32
+github.com/hashicorp/yamux,v0.0.0-20190923154419-df201c70410d,h1:W+SIwDdl3+jXWeidYySAgzytE3piq6GumXeBjFBG67c=,d8a888d6a4ecbc09f2f3663cb47aa2d064298eeb1491f4761a43ae95e93ba035
+github.com/herenow/go-crate,v0.0.0-20190617151714-6f2215a33eca,h1:kk1qCxy+FS5McLJ69dSpB6Y6kHCMa23UwHyglIzJ/bk=,aa618858b9c03e47962afb2a4098ad6cca8ecd09904cdbc5eb62c5a1d74befca
+github.com/hetznercloud/hcloud-go,v1.15.1,h1:G8Q+xyAqQ5IUY7yq4HKZgkabFa0S/VXJXq3TGCeT8JM=,028402928c1bc1db686cab5738e6fb91a61252c1236258e2d911dd8da21f8af5
+github.com/hinshun/vt10x,v0.0.0-20180616224451-1954e6464174,h1:WlZsjVhE8Af9IcZDGgJGQpNflI3+MJSBhsgT5PCtzBQ=,4afc77bd4950db746c68d23e6ed681d31cd952559d712c1400da476084567cf6
+github.com/hjfreyer/taglib-go,v0.0.0-20151027170453-0ef8bba9c41b,h1:Q4OOFmH18aIjnDJlvYm4BXmpHKXk1zTJP0QZ0otNwPs=,e7735f2cdbb7441dbe6bbc303cff9b9a20d9845dc901e31f6e29e3ef83613390
+github.com/howeyc/fsnotify,v0.9.0,h1:0gtV5JmOKH4A8SsFxG2BczSeXWWPvcMT0euZt5gDAxY=,a72f2f092433c8b53e095d6db3d3e18517db1a5a9814a78ed97194239145740f
+github.com/howeyc/gopass,v0.0.0-20190910152052-7cb4b85ec19c,h1:aY2hhxLhjEAbfXOx2nRJxCXezC6CO2V/yN+OCr1srtk=,83560b6c9a6220bcbb4ad2f043e5a190ab11a013b77c1bbff9a3a67ed74d4b37
+github.com/hpcloud/tail,v1.0.0,h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=,3cba484748e2e2919d72663599b8cc6454058976fbca96f9ac78d84f195b922a
+github.com/huandu/xstrings,v1.2.0,h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0=,fe7011ad569e464d6ff81bdb1d80c4ebdb5baac5c89d17c1644a23cac0c48828
+github.com/huin/goupnp,v1.0.0,h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo=,9685536729d9860766846ad4e56fb961b246d5afa209e4058ee0d021aec37827
+github.com/huin/goutil,v0.0.0-20170803182201-1ca381bf3150,h1:vlNjIqmUZ9CMAWsbURYl3a6wZbw7q5RHVvlXTNS/Bs8=,d887199bd2f388075ff7aaf1d3061b13b92c20e01ccd6337c864fd409fe78831
+github.com/hybridgroup/go-ardrone,v0.0.0-20140402002621-b9750d8d7b78,h1:7of6LJZ4LF9AvF4bTiMr2I72KxodBf1BXrSD9Tz0lWU=,997e0efef1b73cc1930ad67cd649268ff864393fa85dedf32672ecca78647021
+github.com/hybridgroup/mjpeg,v0.0.0-20140228234708-4680f319790e,h1:xCcwD5FOXul+j1dn8xD16nbrhJkkum/Cn+jTd/u1LhY=,d9134203da596f895c55c3a9fd0aea32ad26501ca88e646cbe9f82136f592c0f
+github.com/hyperledger/fabric,v1.4.3,h1:6MmYhcDbxhd0TvpvHLR3c5m3fVjaX97690H8TRjpJNA=,067d2bd69094dc9f693d9b00c8bea810f61f6a8a3d0ac640830b468934e22023
+github.com/hyperonecom/h1-client-go,v0.0.0-20190122232013-cf38e8387775,h1:MIteIoIQ5nFoOmwEHPDsqng8d0dtKj3lCnQCwGvtxXc=,135625f81c1c6c62b296269829a74f1266928600545fedec0825cb97284264f6
+github.com/iancoleman/strcase,v0.0.0-20190422225806-e506e3ef7365,h1:ECW73yc9MY7935nNYXUkK7Dz17YuSUI9yqRqYS8aBww=,f93e74faf2e05699180c40ef21204629a1c6bd382658f1059c80631c377c5246
+github.com/ianlancetaylor/demangle,v0.0.0-20181102032728-5e5cf60278f6,h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c=,73ae40ed96af2703f85cd4c552cf6b14551ceb782348be8185b730f44c842ab9
+github.com/iij/doapi,v0.0.0-20190504054126-0bbf12d6d7df,h1:MZf03xP9WdakyXhOWuAD5uPK3wHh96wCsqe3hCMKh8E=,7e33155961c2cba072047deb34d19a7d863a713e502abe8bdc31ab91424bd226
+github.com/ijc/Gotty,v0.0.0-20170406111628-a8b993ba6abd,h1:anPrsicrIi2ColgWTVPk+TrN42hJIWlfPHSBP9S0ZkM=,b8b9a99b3632feb3449d1fb8950d292333f8a7f494b182320ecdb0479d78442f
+github.com/imdario/mergo,v0.3.8,h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ=,579cad1ed913cfcb424deb97e7016749abcc9d585bad07d14f19550df052cec5
+github.com/imkira/go-interpol,v1.1.0,h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk=,de5111f7694700ea056beeb7c1ca1a827075d423422f251076ee17bd869477d9
+github.com/improbable-eng/grpc-web,v0.9.1,h1:tenDg9Lg+zYXeS/ojbKyfwVO5TVYh5FFGsrXNAblF1o=,3a287ae758b41feea9f26ec1b8757628d4742b87376fa40b29d878ee651bfe62
+github.com/imroc/req,v0.2.3,h1:ElMCifcqg/1GonGloyyTUrj6D6IITL6EiNEKHUl4xZM=,951172f0969fa0bad31ebbe9b17699ea3909b09eaf8df39ccd78e48097682c78
+github.com/inconshreveable/go-update,v0.0.0-20160112193335-8152e7eb6ccf,h1:WfD7VjIE6z8dIvMsI4/s+1qr5EL+zoIGev1BQj1eoJ8=,adf856fb49e7c5059b2edb42a31daf4a536dc698fe0728835b018150a884b678
+github.com/inconshreveable/log15,v0.0.0-20180818164646-67afb5ed74ec,h1:CGkYB1Q7DSsH/ku+to+foV4agt2F2miquaLUgF6L178=,31875747bcd198c39714d38747ac77e585620f2f37d1b1e1a03b164af6762995
+github.com/inconshreveable/mousetrap,v1.0.0,h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=,c3fa0813e78f5cef10dc0e9912c43e68e06ff970a98e98c4050fe14dbbfd18c7
+github.com/influxdata/changelog,v1.1.0,h1:HXhmLZDrbuC+Ca5YX7g8B8cH5DmJpaOjd844d9Y7aTQ=,19e60d9b658aaecca4e075126c996c1abd5e369003c14bbe575edc4ba2b9c182
+github.com/influxdata/flux,v0.52.0,h1:R91uUXbHzoiyYF7Xhm+wP3a0iSnl43iYJrN93nBhuP0=,e0121889c46cc4ad22f1662e68df7dbdfbb361c3da6809add4d1409cef764be9
+github.com/influxdata/influxdb,v1.7.9,h1:uSeBTNO4rBkbp1Be5FKRsAmglM9nlx25TzVQRQt1An4=,b49a72374a14f726229e71152e74e8a132c2913137c4457f31bae8c7735e812c
+github.com/influxdata/influxdb1-client,v0.0.0-20190809212627-fc22c7df067e,h1:txQltCyjXAqVVSZDArPEhUTg35hKwVIuXwtQo7eAMNQ=,fc41ea93bf2b06b231823b116dc11b0ed89badf1ce6a4c848a33c77dcf2c123a
+github.com/influxdata/influxql,v1.0.1,h1:6PGG0SunRmptIMIreNRolhQ38Sq4qDfi2dS3BS1YD8Y=,2a697984d1cd82656f69901bfe1771676493411c1370d77271bde3ab3c917a1e
+github.com/influxdata/line-protocol,v0.0.0-20180522152040-32c6aa80de5e,h1:/o3vQtpWJhvnIbXley4/jwzzqNeigJK9z+LZcJZ9zfM=,6111b5e459106f7003477186aa2e34423dbe0c53983944a07d8b835ff8c7757c
+github.com/influxdata/promql/v2,v2.12.0,h1:kXn3p0D7zPw16rOtfDR+wo6aaiH8tSMfhPwONTxrlEc=,b928626f2eb81eed0046ef23a83a77a28dd140d369a0d2538c94e85d1055877f
+github.com/influxdata/tdigest,v0.0.0-20181121200506-bf2b5ad3c0a9,h1:MHTrDWmQpHq/hkq+7cw9oYAt2PqUw52TZazRA0N7PGE=,5d6b056d98d1e7e9cd884aea4e73934cc8ea89218eb43ee1d5140d3ccb34ed52
+github.com/influxdb/influxdb,v1.7.9,h1:KMBwwvyJyBppIwrg5t0662p+Yei/ucnIkqUl8txiQdQ=,ad251d4cc00aec767465dc60d6b702a3635b68402123a4ee5d1ee2b5006310b3
+github.com/iotexproject/go-pkgs,v0.1.1,h1:AyWJf8jqOg4aMSrxi+MInFFBZhTvSm0LCu1o08heijk=,c5099edde7450b4f8b9a0f49c42697f5e9bcb92d2bf58395aa0681f3ef6b583d
+github.com/iotexproject/iotex-address,v0.2.1,h1:ZJH2ajx5OBrbaRJ0ZWlWUo685zr5kjWijVjtmUrm42E=,53c7ce4d7fbc55ee79e92e9e0b31ee3b3ba0e6e5d3e24cd43e0a58c766568c9d
+github.com/iotexproject/iotex-proto,v0.2.5,h1:SYdl9Lqb0LYfFf3sfw92fN8GY3bthfCvGmltz+2uvDQ=,546cb070e92286601aee16d03383712172061c8fe78e53cf04498a9358470a78
+github.com/ipfs/bbloom,v0.0.4,h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs=,92993c175552cc626ef6b1ab6cf887f0f640311748c47e7615df29a966c1b774
+github.com/ipfs/go-bitswap,v0.1.3,h1:jAl9Z/TYObpGeGATUemnOZ7RYb0F/kzNVlhcYZesz+0=,ee26d57b2765f808ebebca8aa18695bfa02b738f47b4b5db5efce5c91f28fbcd
+github.com/ipfs/go-block-format,v0.0.2,h1:qPDvcP19izTjU8rgo6p7gTXZlkMkF5bz5G3fqIsSCPE=,02ad9fa29f97073ece45a5da7a92e59e6c6b856e9a03bd853361b8107296c020
+github.com/ipfs/go-blockservice,v0.1.2,h1:fqFeeu1EG0lGVrqUo+BVJv7LZV31I4ZsyNthCOMAJRc=,31c5ff02d71ee454bebea3944d7e06c2ffd6f1c4cfdddf71c5122e982f261c7d
+github.com/ipfs/go-cid,v0.0.3,h1:UIAh32wymBpStoe83YCzwVQQ5Oy/H0FdxvUS6DJDzms=,f8bd60f8bbd79ed1fa5c8c113f6e17addb12257b0d925d3327ee7c25a7733591
+github.com/ipfs/go-datastore,v0.1.1,h1:F4k0TkTAZGLFzBOrVKDAvch6JZtuN4NHkfdcEZL50aI=,be724f5e3a459cf6ae9e68d2fa14e27cc92c53ae775979f2412b4f5b3f2b0336
+github.com/ipfs/go-detect-race,v0.0.1,h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk=,c00c97cacb355cb0569bee75775eff6b656d95dd7d0855ed97c2ee44666b72cd
+github.com/ipfs/go-ds-badger,v0.0.7,h1:NMyh88Q50HG6/S2YD58DLkq0c0/ZQPMbSojONH+PRf4=,26a453fc19eb26fe6077f12310ff1ad7230fe31b31a0c17fb47abba75379ee61
+github.com/ipfs/go-ds-leveldb,v0.1.0,h1:OsCuIIh1LMTk4WIQ1UJH7e3j01qlOP+KWVhNS6lBDZY=,43085f79b999edef0b8b49dea1ed35d47cc1c453ef401634825c0be5b62ac6d9
+github.com/ipfs/go-hamt-ipld,v0.0.13,h1:Jbt5ALTYnrzbcOBka11kAkgn3auvkQBGkKWjGRsQrio=,e16acbc3f203616ccd9119415b9db28a6f18c72f053259842f7db50aa1193cf8
+github.com/ipfs/go-ipfs-blockstore,v0.1.0,h1:V1GZorHFUIB6YgTJQdq7mcaIpUfCM3fCyVi+MTo9O88=,19a45734b2615632b180b59032d39c04c50fc735c7f9fd27c5547b0facb4ef8f
+github.com/ipfs/go-ipfs-blocksutil,v0.0.1,h1:Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ=,3fcf4221d4d59af5807040f209ff0d28d81f6974d61ac279b43a44b2f46d8182
+github.com/ipfs/go-ipfs-chunker,v0.0.1,h1:cHUUxKFQ99pozdahi+uSC/3Y6HeRpi9oTeUHbE27SEw=,02a0e4766162345a5bea8962c315b4bab8f2550aa1b760dcece96794b3ba22ef
+github.com/ipfs/go-ipfs-config,v0.0.11,h1:5/4nas2CQXiKr2/MLxU24GDGTBvtstQIQezuk7ltOQQ=,e26bdd6db98c4ccf932440aa22a1aa2d550903a0f6f9da82f1ff5902ebbe260e
+github.com/ipfs/go-ipfs-delay,v0.0.1,h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ=,bc3a4494d27cd7fabdeb7036e2edadd27f0edbd2b7d3cf49d14e3402c17c3ab6
+github.com/ipfs/go-ipfs-ds-help,v0.0.1,h1:QBg+Ts2zgeemK/dB0saiF/ykzRGgfoFMT90Rzo0OnVU=,52d0d886ebb65366abb35f19b76c4f6f349464eaedf092da95c661a451b2bf06
+github.com/ipfs/go-ipfs-exchange-interface,v0.0.1,h1:LJXIo9W7CAmugqI+uofioIpRb6rY30GUu7G6LUfpMvM=,0a593df65586ff592255eb69923a43d413b24ad56454e14e94f5e722756fb102
+github.com/ipfs/go-ipfs-exchange-offline,v0.0.1,h1:P56jYKZF7lDDOLx5SotVh5KFxoY6C81I1NSHW1FxGew=,04b69dc6dd34a2c5c2d1f0df8777fcaa8590aa528b960cc26178af6f609e29cf
+github.com/ipfs/go-ipfs-files,v0.0.6,h1:sMRtPiSmDrTA2FEiFTtk1vWgO2Dkg7bxXKJ+s8/cDAc=,442fa790aba0beff3a79503064a35dceab2a29dc4ab8edcca690c7f61ef6c6c0
+github.com/ipfs/go-ipfs-flags,v0.0.1,h1:OH5cEkJYL0QgA+bvD55TNG9ud8HA2Nqaav47b2c/UJk=,61ac13bc74f89286ac30db2ce79b26adfba63a0676cbc430ad750df2d516565a
+github.com/ipfs/go-ipfs-posinfo,v0.0.1,h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs=,149f52f33d8ffd4f82056b4ea1dae2f25024a2e8df0ff555789c549468d998e7
+github.com/ipfs/go-ipfs-pq,v0.0.1,h1:zgUotX8dcAB/w/HidJh1zzc1yFq6Vm8J7T2F4itj/RU=,4eda59f4f898933265b82d381cc1ea5a3d3c75752618f46496a2d150c09aeb2d
+github.com/ipfs/go-ipfs-routing,v0.1.0,h1:gAJTT1cEeeLj6/DlLX6t+NxD9fQe2ymTO6qWRDI/HQQ=,e2281e568eed0ee5621886d28802eefd8a9d0806cbd1db80c01550ad59ec54c7
+github.com/ipfs/go-ipfs-util,v0.0.1,h1:Wz9bL2wB2YBJqggkA4dD7oSmqB4cAnpNbGrlHJulv50=,6d3af4d6dcb95047b64fc74972cdcd84f199c6bad467a7de3543c3eaa0d4ee49
+github.com/ipfs/go-ipld-cbor,v0.0.3,h1:ENsxvybwkmke7Z/QJOmeJfoguj6GH3Y0YOaGrfy9Q0I=,4087b9930a8e2899c3540e61bd8e7f04c8bdd8670f68ddbfcf10f45a0e619cef
+github.com/ipfs/go-ipld-format,v0.0.2,h1:OVAGlyYT6JPZ0pEfGntFPS40lfrDmaDbQwNHEY2G9Zs=,3da08ede588080b6ec81c5ad8fbfb1c9ea306a038be41dc06b1f3a1a101ebe50
+github.com/ipfs/go-log,v0.0.1,h1:9XTUN/rW64BCG1YhPK9Hoy3q8nr4gOmHHBpgFdfw6Lc=,9165a91716b11b432f8bf303d59fc019bf91872f1b9ca7e12d666c11ba6e6676
+github.com/ipfs/go-merkledag,v0.2.4,h1:ZSHQSe9BENfixUjT+MaLeHEeZGxrZQfgo3KT3SLosF8=,ed269e045c613cc7b9bba3593797fe09cdf84c906726bef9261c74bd8c470404
+github.com/ipfs/go-metrics-interface,v0.0.1,h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg=,e83f0c01b084000492db0c0e1a28ff900c3f6d11eea8defdbe8bdd1a04c33fd0
+github.com/ipfs/go-mfs,v0.1.1,h1:tjYEWFIl0W6vRFuM/EnySHaaYzPmDcQWwTjtYWMGQ1A=,1db35113aff60e645544cc64cbbddbf0608332b1f2208615744098af59b97fee
+github.com/ipfs/go-path,v0.0.7,h1:H06hKMquQ0aYtHiHryOMLpQC1qC3QwXwkahcEVD51Ho=,96c607c0253c24ed0cb37016007f34420a3a83c37cdd68b6d4391126418835c4
+github.com/ipfs/go-peertaskqueue,v0.1.1,h1:+gPjbI+V3NktXZOqJA1kzbms2pYmhjgQQal0MzZrOAY=,5fa92b0302d8e72e8c4d74517a68fad04c1d89d90f0a6314a5e30662dda5d359
+github.com/ipfs/go-unixfs,v0.2.2,h1:eTkDT9F0dn4qHmBMVRMZbziwyqLRcogjtPYqMgZYmQs=,77f7f6b2de604b592018dd914a6606084069d22efa70ea95e0dd623a04e4453c
+github.com/ipfs/go-verifcid,v0.0.1,h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2E=,1f808a29fcd38406325435c7a6a02b253aee28832704f0032600c2b41ef3b8f1
+github.com/ipfs/interface-go-ipfs-core,v0.2.4,h1:oQiJ3Mj3rqVJohdi316K3+VSyiADto3Z35ukj7z+UGg=,e1030de5fc1ee1868a87386708be313fc0fcbbe137d5a71d71f28621393f70a2
+github.com/ipfs/iptb,v1.4.0,h1:YFYTrCkLMRwk/35IMyC6+yjoQSHTEcNcefBStLJzgvo=,0b00d0279c700ad687cfbba073f504cc4c8a17ff731550c3784fcb3e24b0c6d5
+github.com/iris-contrib/blackfriday,v2.0.0+incompatible,h1:o5sHQHHm0ToHUlAJSTjW9UWicjJSDDauOOQ2AHuIVp4=,936679f49251da75fde84b8f38884dbce89747b96f8206f7a4675bfcc7dd165d
+github.com/iris-contrib/formBinder,v5.0.0+incompatible,h1:jL+H+cCSEV8yzLwVbBI+tLRN/PpVatZtUZGK9ldi3bU=,6f1fef9e533a1f57a8b033f8c0a135ed038524d7535dd16ba22e9494e3096e3b
+github.com/iris-contrib/go.uuid,v2.0.0+incompatible,h1:XZubAYg61/JwnJNbZilGjf3b3pB80+OQg2qf6c8BfWE=,c6bae86643c2d6047c68c25226a1e75c5331c03466532ee6c943705743949bd9
+github.com/issue9/assert,v1.3.2,h1:IaTa37u4m1fUuTH9K9ldO5IONKVDXjLiUO1T9vj0OF0=,f4349cbd5af134fce10b399717aa4b455b5c73df6c20c1057c6e45973f24a06d
+github.com/issue9/identicon,v0.0.0-20160320065130-d36b54562f4c,h1:A/PDn117UYld5mlxe58EpMguqpkeTMw5/FCo0ZPS/Ko=,5a837560a10469ab524b185a092edf67be85aff5ed794e1fcaaa084cf4540336
+github.com/itchio/arkive,v0.0.0-20190702114012-1bb6c7241ec3,h1:UcZnU7qzWTmZf8v7F3mC79H98I0b77pZz+99vqHFwtI=,dad4e3a988e6834d4ce1c3fb650a8dbb9aedd116ba8b3556c8f8babecdd17ead
+github.com/itchio/dskompress,v0.0.0-20190702113811-5e6f499be697,h1:u3Q2WkrIPYlGEw4fjcImSOrkivWd6SVb0BF0Ehoih9c=,d8379b7e4219f001b61e5c2b3b34b2a6b69f8a55dc1acde2919be3050a7c84f5
+github.com/itchio/go-brotli,v0.0.0-20190702114328-3f28d645a45c,h1:Jf20xV/yR/O6eSUqLTuXhka/+54YR59sGwN7b3MkxYk=,6bab2adfb10a8ae7132e02ed10823df2e91c42dd08a1f3e1835679390ea69927
+github.com/itchio/headway,v0.0.0-20190702175331-a4c65c5306de,h1:RQW9xPqYtvjdHHRZR95XsaEA9B4URCuNHK78IuJcc+Y=,54e63fd6f25217e272e196f6213915515196a5b17a1923a666c05b4f49c82ef3
+github.com/itchio/httpkit,v0.0.0-20190702184704-639fe5edf1f1,h1:mViP/A8hAP04YWbbZR7Kcm7rTkUeT2HLcn3BBiK+CwM=,e56bf70a53a305f6866631d1272a3f3543abd45a68c50d202ddc80796b58c461
+github.com/itchio/kompress,v0.0.0-20190702090658-5e2558a00102,h1:QXEwRXrrx+7CxU+Y+G4GpDk4mUeHbP7grMXHhydk8qU=,cadec4996aed4026c0e0321f90b5bb11d9b8d1de3665752b2e862c6ddbfa229d
+github.com/itchio/ox,v0.0.0-20190925154941-b613e528fc7d,h1:EcmVffUYduCSFCEM12YpSXoVXvyeq8Ro4Q+rwc60TIo=,81c3dfe8e91eb13815bf5b7f159f24a3cb1bd7028a395f691e9cefc1c3a71d01
+github.com/itchio/randsource,v0.0.0-20190702184213-a7635a4cb94b,h1:fG+9RlMeggMG/C2FH80HTfJmm+eOjAve2pFSv6Uio8A=,2375b07785c2738527c864dfb1bee0082b1f89c51e200157165bcd36f5c2933f
+github.com/itchio/savior,v0.0.0-20190925162935-b92976a0b402,h1:a51wRxkLoJWu5NqnVDkI6cE50S0mDpJfOXkCp4ltvr8=,1454524a51fa6492ee593fb7d648dc037fec7c32d90e2d21c149b6e724a74838
+github.com/iwind/TeaGo,v0.0.0-20191007090339-daba0bb6607e,h1:bxD34HpyJWx6bnGdahZo6uN6XnuOvMa8LrzfC+eZqes=,bec78c179e2676d51bb1a07122896661d4ae7727d325e9fa91682361e0321161
+github.com/jackc/chunkreader,v1.0.0,h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0=,e204c917e2652ffe047f5c8b031192757321f568654e3df8408bf04178df1408
+github.com/jackc/chunkreader/v2,v2.0.0,h1:DUwgMQuuPnS0rhMXenUtZpqZqrR/30NWY+qQvTpSvEs=,cae1df6cc4f52abdf31d9c7c9869714f5c2e2dddc8047eb6d335409489e76031
+github.com/jackc/fake,v0.0.0-20150926172116-812a484cc733,h1:vr3AYkKovP8uR8AvSGGUK1IDqRa5lAAvEkZG1LKaCRc=,bf8b5b51ae03f572a70a0582dc663c5733bba9aca785d39bb0367797148e6d64
+github.com/jackc/pgconn,v1.0.1,h1:ZANo4pIkeHKIVD1cQMcxu8fwrwIICLblzi9HCjooZeQ=,4b7e033c80207f032275845f7d366b51b46e3434cafebd13599a351f01f68b86
+github.com/jackc/pgio,v1.0.0,h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=,1a83c03d53f6a40339364cafcbbabb44238203c79ca0c9b98bf582d0df0e0468
+github.com/jackc/pgmock,v0.0.0-20190831213851-13a1b77aafa2,h1:JVX6jT/XfzNqIjye4717ITLaNwV9mWbJx0dLCpcRzdA=,5d8117d8fb79d3a41998bec8dca93d450eba9edf3cf0b8c36881e0ea6140b406
+github.com/jackc/pgpassfile,v1.0.0,h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=,1cc79fb0b80f54b568afd3f4648dd1c349f746ad7c379df8d7f9e0eb1cac938b
+github.com/jackc/pgproto3,v1.1.0,h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A=,e3766bee50ed74e49a067b2c4797a2c69015cf104bf3f3624cd483a9e940b4ee
+github.com/jackc/pgproto3/v2,v2.0.0,h1:FApgMJ/GtaXfI0s8Lvd0kaLaRwMOhs4VH92pwkwQQvU=,22635755552d1363817a9c9f192cf464034dfc31593e4975982a85de8295dcf4
+github.com/jackc/pgtype,v0.0.0-20190828014616-a8802b16cc59,h1:xOamcCJ9MFJTxR5bvw3ZXmiP8evQMohdt2VJ57C0W8Q=,30822259b27010e41850fde5f75166abc90028b9c57e2a77976cab119e01295f
+github.com/jackc/pgx,v3.6.0+incompatible,h1:bJeo4JdVbDAW8KB2m8XkFeo8CPipREoG37BwEoKGz+Q=,07a0cc87069e38acac988cc48e5a6cfd1bfd02b4b843d0e8931e48bb8c25d821
+github.com/jackc/pgx/v4,v4.0.0-pre1.0.20190824185557-6972a5742186,h1:ZQM8qLT/E/CGD6XX0E6q9FAwxJYmWpJufzmLMaFuzgQ=,1782863d2118cd0e63cc50cca24bd79cbea5674bac3b798bf12148400590128d
+github.com/jackc/puddle,v0.0.0-20190608224051-11cab39313c9,h1:KLBBPU++1T3DHtm1B1QaIHy80Vhu0wNMErIFCNgAL8Y=,a780306bb3ad76174eca1d83a6d925fb3f7a13981cda6249e51be64476c76f15
+github.com/jackmordaunt/icns,v0.0.0-20181231085925-4f16af745526,h1:NfuKjkj/Xc2z1xZIj+EmNCm5p1nKJPyw3F4E20usXvg=,06f511df7637fd1424b6f099d7ce7ecf7378e62adc9d13133ce7df419e51faf0
+github.com/jackpal/gateway,v1.0.5,h1:qzXWUJfuMdlLMtt0a3Dgt+xkWQiA5itDEITVJtuSwMc=,adab846630d73763e5a3b984c8264d6503c8cb0b2914df559dacd41f6380e4ef
+github.com/jackpal/go-nat-pmp,v1.0.1,h1:i0LektDkO1QlrTm/cSuP+PyBCDnYvjPLGl4LdWEMiaA=,d7f2409f72895a01e0d11b457eac015dbcd94c2657f95d508e53867ca6b07db1
+github.com/jacobsa/crypto,v0.0.0-20190317225127-9f44e2d11115,h1:YuDUUFNM21CAbyPOpOP8BicaTD/0klJEKt5p8yuw+uY=,ec4d2a1fc28e1d99c68557e38cd77527df5a9f5090aa12876ab4aa6f9137a3d5
+github.com/jacobsa/oglematchers,v0.0.0-20150720000706-141901ea67cd,h1:9GCSedGjMcLZCrusBZuo4tyKLpKUPenUUqi34AkuFmA=,bcd70357107c45c3177c913b718624376b692d39672c157708fe2cd9aa78fcb5
+github.com/jacobsa/oglemock,v0.0.0-20150831005832-e94d794d06ff,h1:2xRHTvkpJ5zJmglXLRqHiZQNjUoOkhUyhTAhEQvPAWw=,5159f5f22d0e130b1fbfdbc96eb9d4653b32bd463439cb0f3c98e179de5daf80
+github.com/jacobsa/ogletest,v0.0.0-20170503003838-80d50a735a11,h1:BMb8s3ENQLt5ulwVIHVDWFHp8eIXmbfSExkvdn9qMXI=,69d96e3ea6e055d68ed46c0c1044a5dfa18064c9d45bc68d5946aa55e048af6b
+github.com/jacobsa/reqtrace,v0.0.0-20150505043853-245c9e0234cb,h1:uSWBjJdMf47kQlXMwWEfmc864bA1wAC+Kl3ApryuG9Y=,a7efb54142e39f4acab39d22db692d5734f818723783646f6727269228deea83
+github.com/jaegertracing/jaeger,v1.14.0,h1:C0En+gfcxf3NsAriMAvQ6LcSFrQ5VQGXddqfty1EpTI=,5f6245d1b0c986c44cc37c7c950f3cf9c2cfd1e0d540905cd4fab9a164684ecd
+github.com/jarcoal/httpmock,v1.0.4,h1:jp+dy/+nonJE4g4xbVtl9QdrUNbn6/3hDT5R4nDIZnA=,5c7d051f237633573a168713760758005724c268242484d982cb0c76dc3f3ee7
+github.com/jaytaylor/html2text,v0.0.0-20190408195923-01ec452cbe43,h1:jTkyeF7NZ5oIr0ESmcrpiDgAfoidCBF4F5kJhjtaRwE=,2369830967f1c18c382cbee77a510431b42275f1f368e3b5cbbdaa782ae24c0d
+github.com/jbenet/go-base58,v0.0.0-20150317085156-6237cf65f3a6,h1:4zOlv2my+vf98jT1nQt4bT/yKWUImevYPJ2H344CloE=,e686d369d490d6728f6e63b1680db3b567c9e884545f8c47ca656f0d944299b7
+github.com/jbenet/go-cienv,v0.1.0,h1:Vc/s0QbQtoxX8MwwSLWWh+xNNZvM3Lw7NsTcHrvvhMc=,3de5dadf2add50bf7fbdf88db4e6d008ba1848516585f7f9dfbf53cb6dc1705c
+github.com/jbenet/go-context,v0.0.0-20150711004518-d14ea06fba99,h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=,4cd0955abeea43dc4b5a08b8769e696109e0376f2a113a9b8eff13cc90cac1c7
+github.com/jbenet/go-temp-err-catcher,v0.0.0-20150120210811-aac704a3f4f2,h1:vhC1OXXiT9R2pczegwz6moDvuRpggaroAXhPIseh57A=,9299671a264400f8f0e145da442aa3216394f324c50f045ef2ed2b898b3945c9
+github.com/jbenet/goprocess,v0.1.3,h1:YKyIEECS/XvcfHtBzxtjBBbWK+MbvA6dG8ASiqwvr10=,026bb36c2d4316ad327f8b2e623f172c01140f699d57ec8609f702df5cdf021d
+github.com/jcmturner/gofork,v1.0.0,h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8=,5e015dd9b038f1dded0b2ded77e529d2f6ba0bed228a98831af5a3610eefcb52
+github.com/jdcloud-api/jdcloud-sdk-go,v1.9.1-0.20190605102154-3d81a50ca961,h1:a2/K4HRhg31A5vafiz5yYiGMjaCxwRpyjJStfVquKds=,93754c3fe6c00591fcd499cf73ad7f66e4ed864619579ff726872a2f50b53dfa
+github.com/jdkato/prose,v1.1.0,h1:LpvmDGwbKGTgdCH3a8VJL56sr7p/wOFPw/R4lM4PfFg=,4e07b4f2012b46465fcc262d907b1cb81699bc61e6fb7a59ee47ea262e4986d1
+github.com/jeffchao/backoff,v0.0.0-20140404060208-9d7fd7aa17f2,h1:mex1izRBCD+7WjieGgRdy7e651vD/lvB1bD9vNE/3K4=,e6daeed2ffbf793cbdab5e21e9ba47ced708e7c594d4155e1964109903bd199f
+github.com/jefferai/isbadcipher,v0.0.0-20190226160619-51d2077c035f,h1:E87tDTVS5W65euzixn7clSzK66puSt1H4I5SC0EmHH4=,c438b15316e4af2487ba2c818288aa15ba19e39b3bf2f83651dcc9d451af6c5b
+github.com/jefferai/jsonx,v1.0.0,h1:Xoz0ZbmkpBvED5W9W1B5B/zc3Oiq7oXqiW7iRV3B6EI=,e8ccf27ffc8d4560e7db02f8a1663fd4605c5996a025f90721f8157fde332be7
+github.com/jellevandenhooff/dkim,v0.0.0-20150330215556-f50fe3d243e1,h1:ujPKutqRlJtcfWk6toYVYagwra7HQHbXOaS171b4Tg8=,8a3ba94d93fb61070bee24ffca5043eb32b4a6aafa9b84e4950a5f8f34328659
+github.com/jessevdk/go-flags,v1.4.0,h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=,a26e72c3f4c220df8b65ac6eb3d358a8ad2efc300b212318582893ea882726f9
+github.com/jfrazelle/go,v1.5.1-1,h1:EJWkn/L/VOoena+VQryO7xEkxz7J6lHvPXAe+Z3Q6Gc=,ff67181f47086da85e0d0896aeffb52142f6f45bd3bbf75b94cd7546365bf140
+github.com/jfrog/gofrog,v1.0.5,h1:pEJmKZ9XgvQH2a8WCqAEeUDSXBCKBMN90QzOiOhBTIs=,bb6267655de882922977dca0860020c4c781bf7b3d6aba3fddc206a21c13784c
+github.com/jfrog/jfrog-client-go,v0.5.5,h1:dYoajyMXcmc13YpZ/NLye0KL7r+QfpP9l8+WriZNZbE=,3d62cf613d821eb41b8b62ff01e09d8d4eed781f4deb52d3dd96e5a636967732
+github.com/jhump/protoreflect,v1.5.0,h1:NgpVT+dX71c8hZnxHof2M7QDK7QtohIJ7DYycjnkyfc=,a6f0926d31ed98d63d04f2aa60a5579cca471e7544cb701202ba5a5fd3134256
+github.com/jimstudt/http-authentication,v0.0.0-20140401203705-3eca13d6893a,h1:BcF8coBl0QFVhe8vAMMlD+CV8EISiu9MGKLoj6ZEyJA=,0bcf35e1ca69658b70fe05050f436b18ae141a08863cf6011afb39edef5c4013
+github.com/jinzhu/copier,v0.0.0-20190924061706-b57f9002281a,h1:zPPuIq2jAWWPTrGt70eK/BSch+gFAGrNzecsoENgu2o=,c05742c031370bace7c0d5b4101d437e59ad4613bb707fda49c365b3e6af8ad2
+github.com/jinzhu/gorm,v1.9.11,h1:gaHGvE+UnWGlbWG4Y3FUwY1EcZ5n6S9WtqBA/uySMLE=,87f36225e1108c93f299d9b7e4cda23c2f9469ce3db0de59df90691c1e740565
+github.com/jinzhu/inflection,v1.0.0,h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=,cf1087a6f6653ed5f366f85cf0110bbbf581d4e9bc8a4d1a9b56765d94b546c3
+github.com/jinzhu/now,v1.0.1,h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M=,5900b34a1d8daa959798e342e684c4237f60ffaebd1aa4201e29a7d3a98d32b7
+github.com/jlaffaye/ftp,v0.0.0-20190126081051-8019e6774408,h1:9AeqmB6KVEJ7GQU985MGQc7Mtxz1+C+JZkgqBnUWqMU=,b1b8b0e10084219eaf1a829778c1b53c049eeb77249a5660b62291cc3b454e6b
+github.com/jmcvetta/neoism,v1.3.1,h1:GCFSl/90OYwEQH5LML/Vy6UlwK4SZ2OIO278UI4K7DE=,93e9ce5946ab71d9d0970e3709716a2b9cc96b4d03cfc708dfba8f062e870885
+github.com/jmcvetta/randutil,v0.0.0-20150817122601-2bb1b664bcff,h1:6NvhExg4omUC9NfA+l4Oq3ibNNeJUdiAF3iBVB0PlDk=,742cb157c8eb74da05a7972de646034cf0ddaba7c89d8aac625ed73027e778c1
+github.com/jmespath/go-jmespath,v0.0.0-20180206201540-c2b33e8439af,h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=,5c18f15c2bcfbbdb4fd15c0598ea5d3a373991a7b46a8f2405d00ac8b6121629
+github.com/jmhodges/clock,v0.0.0-20160418191101-880ee4c33548,h1:dYTbLf4m0a5u0KLmPfB6mgxbcV7588bOCx79hxa5Sr4=,f66a541ce3f97b4696d65282a332e8d08dee3f15271b7c2066050aeb5b7334b7
+github.com/jmhodges/levigo,v1.0.0,h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U=,7f43feb409c9650336152a959d7dc4d8e5a260c92e0212b1d2e0f0a7d3de6d87
+github.com/jmoiron/sqlx,v1.2.0,h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA=,c8000fe80e86eea575e0d3dd0737f6399c1880a420ce2a9d833ca0e0cfc9c875
+github.com/joefitzgerald/rainbow-reporter,v0.1.0,h1:AuMG652zjdzI0YCCnXAqATtRBpGXMcAnrajcaTrSeuo=,889ea7a751c043bd0ea0ee31734011938be19ecbf08e652d53fc41f3eade9435
+github.com/joeshaw/multierror,v0.0.0-20140124173710-69b34d4ec901,h1:rp+c0RAYOWj8l6qbCUTSiRLG/iKnW3K3/QfPPuSsBt4=,e31f735c5f42ac65aef51a70ba1a32b5ac34067a7ba0624192dd41e5ea03aa1e
+github.com/joho/godotenv,v1.3.0,h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=,acef5a394fbd1193f52d0d19690b0bfe82728d18dd3bf67730dc5031c22d563f
+github.com/jonas-p/go-shp,v0.1.1,h1:LY81nN67DBCz6VNFn2kS64CjmnDo9IP8rmSkTvhO9jE=,ac1706c486b7ea7e83eecd1f773259098569d2fe3ad2a53cc32ff89a68915a8f
+github.com/jonboulle/clockwork,v0.1.0,h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=,930d355d1ced60a668bcbca6154bb5671120ba11a34119505d1c0677f7bbbf97
+github.com/joncalhoun/qson,v0.0.0-20170526102502-8a9cab3a62b1,h1:lnrOS18wZBYrzdDmnUeg1OVk+kQ3rxG8mZWU89DpMIA=,062b14a6986be3fb833eb9dd907acb7e563d5b6cfcaee1a04120a9b1fcc2d451
+github.com/josephspurrier/goversioninfo,v0.0.0-20190124120936-8611f5a5ff3f,h1:wBb8/KQrr2tWYffdugrpxOdWyOPSBRNzAR76aF9Nn3Y=,50be4b48f9fb8fbe79a013a791c015c13d7294c5de8f9bee586eaadd6f479459
+github.com/joyent/triton-go,v0.0.0-20190112182421-51ffac552869,h1:BvV6PYcRz0yGnWXNZrd5wginNT1GfFfPvvWpPbjfFL8=,5e875a04efd7f844211b68657d21313ae16b479cb01dc7161811c2c39ac19b18
+github.com/jpillora/backoff,v1.0.0,h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=,f856692c725143c49b9cceabfbca8bc93d3dbde84a0aaa53fb26ed3774c220cc
+github.com/jrick/logrotate,v1.0.0,h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI=,b87ee434f9e2cfda719b639cd5bd0a52523f920f64d23336f88070e9d3765d54
+github.com/jsimonetti/rtnetlink,v0.0.0-20190606172950-9527aa82566a,h1:84IpUNXj4mCR9CuCEvSiCArMbzr/TMbuPIadKDwypkI=,97d995d4ca858da8955aefcead01425d12a91188d6f9b36b5cb63aa35a4ea674
+github.com/json-iterator/go,v1.1.8,h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok=,0de8f316729fb05ba608361323b178aa32944154e77aa208ad2818848b0628e2
+github.com/jstemmer/go-junit-report,v0.0.0-20190106144839-af01ea7f8024,h1:rBMNdlhTLzJjJSDIjNEXX1Pz3Hmwmz91v+zycvx9PJc=,b623acfae0dcc440f81ae14f3c5bc3ca40b1a674660ad549127980f892ab165e
+github.com/jteeuwen/go-bindata,v3.0.7+incompatible,h1:91Uy4d9SYVr1kyTJ15wJsog+esAZZl7JmEfTkwmhJts=,03f794b47c49da98a4eab6c3a7cc49d286f012d64ab832f783b76b9fcd3bd8b2
+github.com/jtolds/gls,v4.20.0+incompatible,h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=,2f51f8cb610e846dc4bd9b3c0fbf6bebab24bb06d866db7804e123a61b0bd9ec
+github.com/jtolds/go-luar,v0.0.0-20170419063437-0786921db8c0,h1:UyVaeqfY1fLPMt1iUTaWsxUNxYAzZVyK+7G+a3sRfhk=,1ed97930b5dfc7f89c84ff3c5ea5a7de9964ccca970f45853d42a13a138b644e
+github.com/jtolds/monkit-hw,v0.0.0-20190108155550-0f753668cf20,h1:XK96humQhnPbQ24uKtSHKbdShDgrKYqlWBNKJTcIKbg=,5d84e6f3f559b67e00b08a5e93e1017866695a4590b97ccb23a82e3ce792ad04
+github.com/juju/ansiterm,v0.0.0-20180109212912-720a0952cc2a,h1:FaWFmfWdAUKbSCtOU2QjDaorUexogfaMgbipgYATUMU=,17d1e05fd6f1c8fdce7ba7495af54f4dac1e155febff56bd6450593b016655c2
+github.com/juju/clock,v0.0.0-20190205081909-9c5c9712527c,h1:3UvYABOQRhJAApj9MdCN+Ydv841ETSoy6xLzdmmr/9A=,f57579c0c104add5228b279c4673f592d5756033d33b085185ef72a3d2f83bfe
+github.com/juju/cmd,v0.0.0-20190815094254-0c5c82a8dfc6,h1:rPqkdymtMRLcCSYKOeIxuw5mmd8dWx8jSq+t9EGBgtA=,c603f2311cf6524a74535eb9d416a83959c03e6ad52ab4ec081cbc7343734af6
+github.com/juju/collections,v0.0.0-20180717171555-9be91dc79b7c,h1:m/Uo8B7nrH3K6nvk66Y67T7cbHcyY101rW24vGuMON8=,18275066d75835f37845565980c0ac818f9c29145f756b1eeacb6496dac3ebd3
+github.com/juju/errors,v0.0.0-20190930114154-d42613fe1ab9,h1:hJix6idebFclqlfZCHE7EUX7uqLCyb70nHNHH1XKGBg=,2519c885f89cfba663da3bd9a1ff2532e3ae948bdea3e44b42603d8f91cc0796
+github.com/juju/gnuflag,v0.0.0-20171113085948-2ce1bb71843d,h1:c93kUJDtVAXFEhsCh5jSxyOJmFHuzcihnslQiX8Urwo=,47cdfb1bf94a2719e97e03caf4e0dc1cb89ba27c35ed7ce7020701fe8ee2c353
+github.com/juju/gojsonpointer,v0.0.0-20150204194629-afe8b77aa08f,h1:QzpKmMsaP06HVZnYNlcy1CLIXPytsj2NuzfCHitxuus=,0e75303c5dc230f30a629963589376030c3c2a1152a40b9e2075a084224eb173
+github.com/juju/gojsonreference,v0.0.0-20150204194633-f0d24ac5ee33,h1:huRsqE0iXmVPTML75YvFBOiaNj4ZiCZgKVnkRQ06d3w=,d1648b2f71dfbb02acc4a18c55711c721e0f6b50a5280d852cd9c0a639e8ebe6
+github.com/juju/gojsonschema,v0.0.0-20150312170016-e1ad140384f2,h1:VqIDC6dRE0C7wEtTdT6zx2zP5omaoJiZXp2g/dBHRcE=,a9f736e7cb462ccf3b2cb03aa8a133db13dc8d938a2753329a7a1274bdca2656
+github.com/juju/httpprof,v0.0.0-20141217160036-14bf14c30767,h1:COsaGcfAONDdIDnGS8yFdxOyReP7zKQEr7jFzCHKDkM=,9a8c77f887765536c312c89d73d7568126393c7d38c473a50addbec30f8c80ec
+github.com/juju/httprequest,v2.0.0+incompatible,h1:+WtiSbRkEwdqKRBi+4JH8PTdNxBa/h8U8RIzdYaMENI=,0d2ae765c01f7956da6896b7c7d8bb1ad4065e960b93c09a644e2e61a0acaa52
+github.com/juju/jsonschema,v0.0.0-20161102181919-a0ef8b74ebcf,h1:SGTxyCG74uh2dYdBJCUJOo2FSx0fRHP7nMRH7s5JVeQ=,a5681c88d87b34d10dcf701b10d149303fa6d152ee224dc1bd7bd7680da80bfa
+github.com/juju/loggo,v0.0.0-20190526231331-6e530bcce5d8,h1:UUHMLvzt/31azWTN/ifGWef4WUqvXk0iRqdhdy/2uzI=,3db058c07ced25b8689f5d3e462d344ffb965c6f371eabc0396ce94d927e6206
+github.com/juju/lru,v0.0.0-20190314140547-92a0afabdc41,h1:/ucixsNZ+l94agL5LZioJ4ECyOz7kOYY+DKb/0NN6ME=,8f41907249beb66ba4dee5df1f53c37f387506e21568cc89db4b72493b970e85
+github.com/juju/os,v0.0.0-20191022170002-da411304426c,h1:iJZl5krsl2AqkgU7IiJ2/jNAchctLFa3BiKdyOUvK+g=,b236cb3d90b3fae0f83e767feef3a17b472ab0fe238ac08810c4f9c1d683c14d
+github.com/juju/proxy,v0.0.0-20180523025733-5f8741c297b4,h1:y2eoq0Uof/dWLAXRyKKGOJuF0TEkauPscQI7Q1XQqvM=,443cd58a22392e66576d883b9d04c17faebafa37a406a346b671f7e994436c34
+github.com/juju/pubsub,v0.0.0-20190419131051-c1f7536b9cc6,h1:2aARJxmMC2IF9GqVtt5PYcIy4jyuAcR44byqwXKTK0o=,b908f7985f6250270708c2c46ca0ccfc17a3705fea4a27da6f1277a9f6b5404c
+github.com/juju/qthttptest,v0.0.1,h1:pR8nTl6Uo/iI6/ynQf5Cxy9FEICXzaa83NtrBdGMCVQ=,4ba292a46e27af468c181118214f7eb1bfc015f289e90841d7746b954f20ba49
+github.com/juju/ratelimit,v1.0.1,h1:+7AIFJVQ0EQgq/K9+0Krm7m530Du7tIz0METWzN0RgY=,c9af5c6719ce3b6912579a029cb2a651707aa25daa1921488f9cae9c4f8ed334
+github.com/juju/retry,v0.0.0-20180821225755-9058e192b216,h1:/eQL7EJQKFHByJe3DeE8Z36yqManj9UY5zppDoQi4FU=,c5b2437ff128cf13f2d6f3cc3b7e226f2c0119e22caed286946245150b9428e7
+github.com/juju/schema,v1.0.0,h1:sZvJ7iQXHhMw/lJ4YfUmq+fe7R2ZSUzZzd/eSokaB3M=,746bcab557bed4e05456419e5012573dc8481dc8740309100e4bd901ff282a39
+github.com/juju/testing,v0.0.0-20191001232224-ce9dec17d28b,h1:Rrp0ByJXEjhREMPGTt3aWYjoIsUGCbt21ekbeJcTWv0=,317de254f343f9aff6e1226b4ea225cab92fee84667db8e72d541667715ea610
+github.com/juju/txn,v0.0.0-20190612234757-afeb83d59782,h1:FcaMWAFKHuxS7UAaB/GuLWrqI9L7f20m6aXaxg+t5lY=,4656c1c5f0e3dac641999feba77879c7206aff1d606513d7bdb3be7d17a6635c
+github.com/juju/utils,v0.0.0-20180820210520-bf9cc5bdd62d,h1:irPlN9z5VCe6BTsqVsxheCZH99OFSmqSVyTigW4mEoY=,8edd8a74c692eb717156a2bb689e1e24a446656677760dc7dc06b761ee451df5
+github.com/juju/version,v0.0.0-20180108022336-b64dbd566305,h1:lQxPJ1URr2fjsKnJRt/BxiIxjLt9IKGvS+0injMHbag=,73312c50c8b4f6f8644aaccc09b71a2235c8083cfc6c99425540f3c0a3c29e64
+github.com/juju/webbrowser,v1.0.0,h1:JLdmbFtCGY6Qf2jmS6bVaenJFGIFkdF1/BjUm76af78=,7b38f053656e4a883bc122589994e4ec34eae3f833e899450650752d5b72eec8
+github.com/juliangruber/go-intersect,v1.0.0,h1:0XNPNaEoPd7PZljVNZLk4qrRkR153Sjk2ZL1426zFQ0=,e7f539e6b13470da34009d3ab44c6ba84a6b9bb9f6e92d315551919287a25e3c
+github.com/julienschmidt/httprouter,v1.3.0,h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=,e457dccd7015f340664e3b8cfd41997471382da2f4a743ee55be539abc6ca1f9
+github.com/jung-kurt/gofpdf,v1.0.3-0.20190309125859-24315acbbda5,h1:PJr+ZMXIecYc1Ey2zucXdR73SMBtgjPgwa31099IMv0=,f0fa70ade137185bbff2f016831a2a456eaadc8d14bc7bf24f0229211820c078
+github.com/justinas/alice,v0.0.0-20171023064455-03f45bd4b7da,h1:5y58+OCjoHCYB8182mpf/dEsq0vwTKPOo4zGfH0xW9A=,3d6623831901bb973db882bbaffcff3f55849724100ee72c5bf8d0fdfa927ae4
+github.com/jzelinskie/whirlpool,v0.0.0-20170603002051-c19460b8caa6,h1:RyOL4+OIUc6u5ac2LclitlZvFES6k+sg18fBMfxFUUs=,ca0115fcfaaa03f1973f65d05c6d6aefdbdeca6507cdda4359fdf55fd0be2c48
+github.com/k0kubun/colorstring,v0.0.0-20150214042306-9440f1994b88,h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM=,32a2eac0ffb69c6882b32ccfcdd76968cb9dfee9d9dc3d469fc405775399167c
+github.com/k0kubun/pp,v3.0.1+incompatible,h1:3tqvf7QgUnZ5tXO6pNAZlrvHgl6DvifjDrd9g2S9Z40=,2b91f559df17a49554094e4befd7e1c7d32ba4519417b1b36796d9b49d7328c5
+github.com/kami-zh/go-capturer,v0.0.0-20171211120116-e492ea43421d,h1:cVtBfNW5XTHiKQe7jDaDBSh/EVM4XLPutLAGboIXuM0=,fb1ef7d18f4cec39e9115fb200fbf7d5cff65674afe6ecc63ad57d413f503830
+github.com/kamilsk/retry/v4,v4.3.1,h1:hNQmK1xAgybAVsadNAGvCNutFLS2h+Ycpw317u4d+i0=,74181d82f9bba5b7c313c6b338f127668fffbede70f5495a4a2ef8fddaa6c20f
+github.com/kardianos/osext,v0.0.0-20190222173326-2bc1f35cddc0,h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA=,10976c39b58f218a6e29687d19763845e7650d04ac86096cd67ace58f4e56346
+github.com/karrick/godirwalk,v1.13.0,h1:GJq8GHQEAPsjwqfGhLNXBO5P0dS2HYdDRVWe+P4E/EQ=,9652ac9eb85bf13594ba9c41a86864ec5236e429a65f6bbb19c6897d1e335092
+github.com/kataras/golog,v0.0.9,h1:J7Dl82843nbKQDrQM/abbNJZvQjS6PfmkkffhOTXEpM=,bb4d1476d5cbe33088190116a5af7b355fd62858127a8ea9d30d77701279350e
+github.com/kataras/iris,v11.1.1+incompatible,h1:c2iRKvKLpTYMXKdVB8YP/+A67NtZFt9kFFy+ZwBhWD0=,9aba6b1128d42ee2b63a9319e28c1b665b7e82dde1b10763ee7510bcc6427a25
+github.com/kataras/pio,v0.0.0-20190103105442-ea782b38602d,h1:V5Rs9ztEWdp58oayPq/ulmlqJJZeJP6pP79uP3qjcao=,70a50855f07ff59d96db9633a0cf729280a8b9f7af72b936fe8a28e48406432f
+github.com/kavu/go_reuseport,v1.4.0,h1:YIp/96RZ3sJfn0LN+FFkkXIq3H3dfVOdRUtNejhDcxc=,b08d4f774766e1136fd256484f2584d42cd568b5edc7dbc7b19e1259b5dbb75c
+github.com/kballard/go-shellquote,v0.0.0-20180428030007-95032a82bc51,h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=,ae4cb7b097dc4eb0c248dff00ed3bbf0f36984c4162ad1d615266084e58bd6cc
+github.com/kellydunn/golang-geo,v0.7.0,h1:A5j0/BvNgGwY6Yb6inXQxzYwlPHc6WVZR+MrarZYNNg=,4f4699636a450e20bd107fb81894fcdcc8ceeddbac7062e9457c67326c1fb036
+github.com/kelseyhightower/envconfig,v1.4.0,h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=,af674112c38290862e5f59fc2867b81f7b0e623ec2fd1465cd3812e538b351d3
+github.com/kennygrant/sanitize,v1.2.4,h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o=,733211913a22ff6eb5843455345fde8c0c3cff25cc5e8e8225c330fb4c6a72df
+github.com/kevinburke/ssh_config,v0.0.0-20190725054713-01f96b0aa0cd,h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY=,ebd98d4bfd0deb1825d9a54689560b42a17d87385222971117ad72e7ad2f36fa
+github.com/keybase/go-crypto,v0.0.0-20190403132359-d65b6b94177f,h1:Gsc9mVHLRqBjMgdQCghN9NObCcRncDqxJvBvEaIIQEo=,a839bacd8eb0a61a72f84678d568d8df899b512510a326e06db0f191e8c1c5a1
+github.com/kisielk/errcheck,v1.2.0,h1:reN85Pxc5larApoH1keMBiu2GWtPqXQ1nc9gx+jOU+E=,709eeca978804f41720a94bc69ee3cfa8277f7d15016478a3ebda86606a286c5
+github.com/kisielk/gotool,v1.0.0,h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=,089dbba6e3aa09944fdb40d72acc86694e8bdde01cfc0f40fe0248309eb80a3f
+github.com/kisielk/sqlstruct,v0.0.0-20150923205031-648daed35d49,h1:o/c0aWEP/m6n61xlYW2QP4t9424qlJOsxugn5Zds2Rg=,dbff9241f676de69e88bc006004da6087576433457b306f53cb952d0313ccb78
+github.com/kisom/goutils,v1.1.0,h1:z4HEOgAnFq+e1+O4QdVsyDPatJDu5Ei/7w7DRbYjsIA=,a0b58731f8e1144c013107294885891c44b7fd3235da0ec20776f4d644b4eaa4
+github.com/kkdai/bstream,v1.0.0,h1:Se5gHwgp2VT2uHfDrkbbgbgEvV9cimLELwrPJctSjg8=,dc1d546e0df6ef040963bc9d483834d6e56c77e0e4f6c48e574ac360e7723121
+github.com/klauspost/compress,v1.8.2,h1:Bx0qjetmNjdFXASH02NSAREKpiaDwkO1DRZ3dV2KCcs=,4dc2632696a9cd93cc32c1564e1a6aa4aecfcb5c995a077d45c6f92116e1711d
+github.com/klauspost/cpuid,v1.2.1,h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w=,8367d6c97e74f88b149ba9de708ff321273e0114aeb71a45e62e5ac296412420
+github.com/klauspost/crc32,v0.0.0-20161016154125-cb6bfca970f6,h1:KAZ1BW2TCmT6PRihDPpocIy1QTtsAsrx6TneU/4+CMg=,6b632853a19f039138f251f94dbbdfdb72809adc3a02da08e4301d3d48275b06
+github.com/klauspost/pgzip,v1.2.1,h1:oIPZROsWuPHpOdMVWLuJZXwgjhrW8r1yEX8UqMyeNHM=,a482336aa4b0e4e9368b15d75629ae741b44ef290b7d16430ba05ce561846213
+github.com/klauspost/reedsolomon,v1.9.2,h1:E9CMS2Pqbv+C7tsrYad4YC9MfhnMVWhMRsTi7U0UB18=,ea8a4d6d994088dae0308843fd6bddb7541cf36306463a696fd4a29097496705
+github.com/knative/pkg,v0.0.0-20191031171713-d4ce00139499,h1:ha5eqzJaPg1CZroomqWxHqspOqpqpRMO3fDtgF1fvIM=,a8d19fc2196a1aec7869ca45df44ba9c5de5b81b6094f0579d25989eb7967660
+github.com/kniren/gota,v0.9.0,h1:ywFrdNxkBD5Xypk5BxjCaKiH507oQVXIf31pTvRhC4I=,062182a345c456c9c0fd7ce9644900708f7f9c08707d64fe2438b9d295dad6dd
+github.com/knq/sysutil,v0.0.0-20191005231841-15668db23d08,h1:V0an7KRw92wmJysvFvtqtKMAPmvS5O0jtB0nYo6t+gs=,81ec4ac93dba6a6161264a0575f20235d8932abab0cd6b9777b4be936f5c2af5
+github.com/knqyf263/berkeleydb,v0.0.0-20190501065933-fafe01fb9662,h1:UGS0RbPHwXJkq8tcba8OD0nvVUWLf2h7uUJznuHPPB0=,1e575b5fdc170e0318ab06841873ae6d115978fbaffc3779290d7ba3aadbdf0e
+github.com/knqyf263/go-deb-version,v0.0.0-20190517075300-09fca494f03d,h1:X4cedH4Kn3JPupAwwWuo4AzYp16P0OyLO9d7OnMZc/c=,4a09d0533768cf6f9d929858aa2e79b6942685569c2db00b8d4688590a89ba3d
+github.com/knqyf263/go-rpmdb,v0.0.0-20190501070121-10a1c42a10dc,h1:pumO9pqmRAjvic6oove22RGh9wDZQnj96XQjJSbSEPs=,33a3568289d22672dfcb0ba7c5b8aa7f9223d5303003368e7dbe8c9718a803b4
+github.com/knqyf263/nested,v0.0.1,h1:Sv26CegUMhjt19zqbBKntjwESdxe5hxVPSk0+AKjdUc=,c0e123844a174b1e9929d4368d8a8bb2f5ecef578ee9dee692c5971a47a633ff
+github.com/koki/structurederrors,v0.0.0-20180506174113-6b997eb5e2ca,h1:KmXUVzyPjXzd3kY0feNFsWOGVDYFT4MjjgG8QJx0m6k=,1efa717c181722fd1c6807919571dc559b48d17120f5eeb4638a322fb882411a
+github.com/kolo/xmlrpc,v0.0.0-20190717152603-07c4ee3fd181,h1:TrxPzApUukas24OMMVDUMlCs1XCExJtnGaDEiIAR4oQ=,9d37c94f50784536aa8ef9a7623ec7bcac9e5bc67b18f7a801efc7cbbe6b1ab0
+github.com/konsorten/go-windows-terminal-sequences,v1.0.2,h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=,4d00d71b8de60bcaf454f8f867210ebcd05e75c0a7c2725904f71aa2f20fb08e
+github.com/koron/go-ssdp,v0.0.0-20180514024734-4a0ed625a78b,h1:wxtKgYHEncAU00muMD06dzLiahtGM1eouRNOzVV7tdQ=,3a99f050b7a668291942cada4e38213965fa0ae3794469bb29ad0d6d9677db23
+github.com/kr/fs,v0.1.0,h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=,d376bd98e81aea34585fc3b04bab76363e9e87cde69383964e57e9779f2af81e
+github.com/kr/logfmt,v0.0.0-20140226030751-b84e30acd515,h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=,ebd95653aaca6182184a1b9b309a65d55eb4c7c833c5e790aee11efd73d4722c
+github.com/kr/pretty,v0.1.0,h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=,06063d21457e06dc2aba4a5bd09771147ec3d8ab40b224f26e55c5a76089ca43
+github.com/kr/pty,v1.1.8,h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI=,d66e6fbc65e772289a7ff8c58ab2cdfb886253053b0cea11ba3ca1738b2d6bc6
+github.com/kr/text,v0.1.0,h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=,9363a4c8f1f3387a36014de51b477b831a13981fc59a5665f9d21609bea9e77c
+github.com/kshvakov/clickhouse,v1.3.4,h1:p/yqvOmeDRH+KyCH6NtwExelr4rimLBBfKW2a/wBN94=,01a0d1a90e0545da94350319a52c051257fee64c838e2632ec40ef8d89a2f153
+github.com/kylelemons/go-gypsy,v0.0.0-20160905020020-08cad365cd28,h1:mkl3tvPHIuPaWsLtmHTybJeoVEW7cbePK73Ir8VtruA=,321087246482a680bd3f06de64075fb843430da544596ad216a4a63d5b8dafa3
+github.com/kylelemons/godebug,v1.1.0,h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=,dbbd0ce8c2f4932bb03704d73026b21af12bd68d5b8f4798dbf10a487a2b6d13
+github.com/kyokomi/emoji,v2.1.0+incompatible,h1:+DYU2RgpI6OHG4oQkM5KlqD3Wd3UPEsX8jamTo1Mp6o=,0721a2fc643e49e002bd8a3e604b5d2f0f3e242cc279d14d76f90a55f8aeebf7
+github.com/labbsr0x/bindman-dns-webhook,v1.0.2,h1:I7ITbmQPAVwrDdhd6dHKi+MYJTJqPCK0jE6YNBAevnk=,d1a327ab22f62486250f50f98990c0d9e1a5fdece6a496fbbb85d4e123df3244
+github.com/labbsr0x/goh,v1.0.1,h1:97aBJkDjpyBZGPbQuOK5/gHcSFbcr5aRsq3RSRJFpPk=,84c91135623961c7c400bf8b646da76c0ce2941fe8706d5aef5650be9a5e37dd
+github.com/labstack/echo,v3.3.10+incompatible,h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg=,29634743cf44c47079b74812ecf5aa7074630507886c4ff40b60c397c45af524
+github.com/labstack/gommon,v0.3.0,h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=,2783ed1c24d09a5539bc35954f71f41d270d78dc656be256c98a8ede2cbbe451
+github.com/lafriks/xormstore,v1.0.0,h1:P/IJzNSIpjXl/Up3o2Td5ZU/x4v6DEKLMaPQJGtmJCk=,0e347e24ab91f62e1b69bab5d78cbba77569f087b483569ef37761e1f93a3f46
+github.com/lann/builder,v0.0.0-20180802200727-47ae307949d0,h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw=,1fe7a88079ff2bbe90fb4724fb5c353ecb6af4cd7e011440354c804f678895ee
+github.com/lann/ps,v0.0.0-20150810152359-62de8c46ede0,h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk=,76756d46634f44edd3facdb01e7271ddf23a1b51a8423de55d3a2bf685ff032a
+github.com/leanovate/gopter,v0.2.4,h1:U4YLBggDFhJdqQsG4Na2zX7joVTky9vHaj/AGEwSuXU=,99b27788411d478764bf7c51e4f6e84e5ccd60f3959a88a03e96b2a1d519a45d
+github.com/leodido/go-urn,v1.2.0,h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=,8a854d784171000a69b79babb2cd3da9b8fccb1e1b6bb102c7a6d2b52380d08a
+github.com/lestrrat-go/jspointer,v0.0.0-20181205001929-82fadba7561c,h1:pGh5EFIfczeDHwgMHgfwjhZzL+8/E3uZF6T7vER/W8c=,a64de11dd2840c3251906c5fe5f61719713af52a41287411007434684745af39
+github.com/lestrrat-go/jsref,v0.0.0-20181205001954-1b590508f37d,h1:1eeFdKL5ySmmYevvKv7iECIc4dTATeKTtBqP4/nXxDk=,1acee9b59501460f5063a82bc2c05f1a11cd24077198fc08ba100ee642d3db72
+github.com/lestrrat-go/jsschema,v0.0.0-20181205002244-5c81c58ffcc3,h1:TSKrrGm89gmmVlrG34ZzCIOMNVk5kkSV1P88Dt38DiE=,1b7552a5ecd193bdd07995226f58fe48de0aadedbcb42f3a5b135fd7b3538ea4
+github.com/lestrrat-go/jsval,v0.0.0-20181205002323-20277e9befc0,h1:w4rIjeCV/gQpxtn3i1voyF6Hd7v1mRGIB63F7RZOk1U=,f060af1b36e0f156546436dcc9b1569600871185d69e9daf214f24e0e2934784
+github.com/lestrrat-go/pdebug,v0.0.0-20180220043849-39f9a71bcabe,h1:S7XSBlgc/eI2v47LkPPVa+infH3FuTS4tPJbqCtJovo=,17690c72219264e0a195dac69ae6ed12bbadf309242dbaa21609339dfa74b3a5
+github.com/lestrrat-go/structinfo,v0.0.0-20190212233437-acd51874663b,h1:YUFRoeHK/mvRjBR0bBRDC7ZGygYchoQ8j1xMENlObro=,8dd77f51595dea974553558e0d249059b9047a39354548b5bbd88b32cf3df75a
+github.com/lestrrat/go-jsschema,v0.0.0-20181205002244-5c81c58ffcc3,h1:UaOmzcaCH2ziMcSbQFBq/3Iuz/E/Jr/GOGtV80jpFII=,ce0f1e04d70eadcc75f96d70703b53231e1c5be7d9fd832c144e0135bfd5afb4
+github.com/lib/pq,v1.2.0,h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0=,cb1028c395747cacafb6c3c6ad5fa244563ce641aae45cf7742f98b6764b1fde
+github.com/libp2p/go-addr-util,v0.0.1,h1:TpTQm9cXVRVSKsYbgQ7GKc3KbbHVTnbostgGaDEP+88=,d49a37e15540c8b95f845dde6cdf802e7af490bc13fd88fec3da318d08464f7b
+github.com/libp2p/go-buffer-pool,v0.0.2,h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs=,fef932705b72198df3d50befd9d2aa157aea1b5f3d23712b09d627d02cfe841e
+github.com/libp2p/go-conn-security,v0.0.1,h1:4kMMrqrt9EUNCNjX1xagSJC+bq16uqjMe9lk1KBMVNs=,e7b58f887c8a8a2ed0178d2f0d6b4ad36bdd7b8cf52ca4d66bafc108b80d095c
+github.com/libp2p/go-conn-security-multistream,v0.1.0,h1:aqGmto+ttL/uJgX0JtQI0tD21CIEy5eYd1Hlp0juHY0=,597b249bd51de097142815318b13c339752532f15131887492d9d3e3407ab92e
+github.com/libp2p/go-eventbus,v0.1.0,h1:mlawomSAjjkk97QnYiEmHsLu7E136+2oCWSHRUvMfzQ=,1b02c8340d2740f99d67078a8c8823c6b9212b92dd9ca7eaf2a38adf2bfd6b56
+github.com/libp2p/go-flow-metrics,v0.0.1,h1:0gxuFd2GuK7IIP5pKljLwps6TvcuYgvG7Atqi3INF5s=,f783542a7fce8382de9cea6940049b106cc35f9714126a1e3d61925c29db8617
+github.com/libp2p/go-libp2p-autonat,v0.1.0,h1:aCWAu43Ri4nU0ZPO7NyLzUvvfqd0nE3dX0R/ZGYVgOU=,11e86ef0b36125a7cd6aa447ffe488f7f3ab00e441bdf8cf30a832a41da4342c
+github.com/libp2p/go-libp2p-blankhost,v0.1.4,h1:I96SWjR4rK9irDHcHq3XHN6hawCRTPUADzkJacgZLvk=,9cd5abe8ad2f137c13309a9dbdd213376bbec03f9685cf8cde7fbfe2e5783e7d
+github.com/libp2p/go-libp2p-circuit,v0.1.0,h1:eniLL3Y9aq/sryfyV1IAHj5rlvuyj3b7iz8tSiZpdhY=,24ee6c7851f4f0072922ae497c230718a0f44beab890d0403261b38a2946a866
+github.com/libp2p/go-libp2p-core,v0.2.4,h1:Et6ykkTwI6PU44tr8qUF9k43vP0aduMNniShAbUJJw8=,d521cc1bffba8afc8b8057901cf22c2f6ffd88faec0274426e13c4e7c12c756c
+github.com/libp2p/go-libp2p-crypto,v0.1.0,h1:k9MFy+o2zGDNGsaoZl0MA3iZ75qXxr9OOoAZF+sD5OQ=,14ef1867bd8b0ef8fc528f5069ef267270dd0de8cf89a235beb9fbd79e4bed8d
+github.com/libp2p/go-libp2p-discovery,v0.2.0,h1:1p3YSOq7VsgaL+xVHPi8XAmtGyas6D2J6rWBEfz/aiY=,d1c0800b601cbe6833522727b249567379422e9f324b7d0a0866bd86c74fb930
+github.com/libp2p/go-libp2p-host,v0.1.0,h1:OZwENiFm6JOK3YR5PZJxkXlJE8a5u8g4YvAUrEV2MjM=,d26bf1db299917f080a13ace37ef4363c08c2407c126cee59e642b1372d2b211
+github.com/libp2p/go-libp2p-interface-connmgr,v0.0.5,h1:KG/KNYL2tYzXAfMvQN5K1aAGTYSYUMJ1prgYa2/JI1E=,fe1e74365cc5c155161e5500671a8e9a85a90efdad9f5630bdfdc15bdfc52fe5
+github.com/libp2p/go-libp2p-interface-pnet,v0.0.1,h1:7GnzRrBTJHEsofi1ahFdPN9Si6skwXQE9UqR2S+Pkh8=,9767f78f87f54bdf3fb1f0f9b5f67e907463b445a00a566402bacca85749c8fe
+github.com/libp2p/go-libp2p-loggables,v0.1.0,h1:h3w8QFfCt2UJl/0/NW4K829HX/0S4KD31PQ7m8UXXO8=,351c87c02c2b147193fac5c441d8767d2b247cd3f3c420fa205da2ccd1c3f00f
+github.com/libp2p/go-libp2p-metrics,v0.1.0,h1:v7YMUTHNobFaQeqaMfJJMbnK3EPlZeb6/KFm4gE9dks=,a86fe0ae6cda820fd6a0e576bcd94a22360439819f344a9121086b31c651caaf
+github.com/libp2p/go-libp2p-mplex,v0.2.1,h1:E1xaJBQnbSiTHGI1gaBKmKhu1TUKkErKJnE8iGvirYI=,f11961ef5114e57eb176740a066e1535132c8c238bd444ed53d94fad36ba7708
+github.com/libp2p/go-libp2p-nat,v0.0.4,h1:+KXK324yaY701On8a0aGjTnw8467kW3ExKcqW2wwmyw=,4c3db4e0f7f714439364ca0853f63d426bba67924da6fd050fd0184abdfec2df
+github.com/libp2p/go-libp2p-net,v0.1.0,h1:3t23V5cR4GXcNoFriNoZKFdUZEUDZgUkvfwkD2INvQE=,4140afd418393c2a4ecccca97d80b4752d20da6f34fac15fbdc4f0566f7b8cea
+github.com/libp2p/go-libp2p-netutil,v0.1.0,h1:zscYDNVEcGxyUpMd0JReUZTrpMfia8PmLKcKF72EAMQ=,c98ad0a3ffab37b6a0bc80aefba4e4cb442b09c01277a7dcc0086c4a004e649a
+github.com/libp2p/go-libp2p-peer,v0.2.0,h1:EQ8kMjaCUwt/Y5uLgjT8iY2qg0mGUT0N1zUjer50DsY=,5b400d6b6337cc759846d7ddf50ec2d761148e1447a86982696687ef1e792c1a
+github.com/libp2p/go-libp2p-peerstore,v0.1.4,h1:d23fvq5oYMJ/lkkbO4oTwBp/JP+I/1m5gZJobNXCE/k=,1606c0bb56c31d0249980b8a0c0e5dda9212687b1994ef47cfd42039d4cf1847
+github.com/libp2p/go-libp2p-protocol,v0.1.0,h1:HdqhEyhg0ToCaxgMhnOmUO8snQtt/kQlcjVk3UoJU3c=,4560018136a73817e03eed49af46d97dd561b3eeffb1ff00559152acf9a74627
+github.com/libp2p/go-libp2p-pubsub,v0.2.0,h1:4UXcjpQdpam/RsGhfWyT/4u5f6F42ods/WgDAaocYxA=,bde7bb50d950b8ea7902c523a696eff4ad7b5d0daac808356358ff6d53aecb14
+github.com/libp2p/go-libp2p-record,v0.1.1,h1:ZJK2bHXYUBqObHX+rHLSNrM3M8fmJUlUHrodDPPATmY=,27a3e94e144b893cbb5ceaddfa7a4e456052e173f807db52945e06920f62d0b3
+github.com/libp2p/go-libp2p-routing,v0.1.0,h1:hFnj3WR3E2tOcKaGpyzfP4gvFZ3t8JkQmbapN0Ct+oU=,4241980dadf216e937a42a572a9c5b5eb28ff62458380ad37892c5b5095de270
+github.com/libp2p/go-libp2p-secio,v0.2.0,h1:ywzZBsWEEz2KNTn5RtzauEDq5RFEefPsttXYwAWqHng=,979a82829f3188d4ca8d20d194923c5620ff12a161d13c945c1630b7b9d050ff
+github.com/libp2p/go-libp2p-swarm,v0.2.2,h1:T4hUpgEs2r371PweU3DuH7EOmBIdTBCwWs+FLcgx3bQ=,b920f69fbfaa8805047b958c6d45d944a195181dd6dddab36bead5fe68f2f1e4
+github.com/libp2p/go-libp2p-testing,v0.1.0,h1:WaFRj/t3HdMZGNZqnU2pS7pDRBmMeoDx7/HDNpeyT9U=,e1c7fa467d88b33f2fc519542cc19aa48bcade304f579f10ab402a19c38d0aa6
+github.com/libp2p/go-libp2p-transport,v0.0.5,h1:pV6+UlRxyDpASSGD+60vMvdifSCby6JkJDfi+yUMHac=,df7bc96a5d76c351fd3a6ee29995f4974013d9709904edd9608b86f4fa089ad2
+github.com/libp2p/go-libp2p-transport-upgrader,v0.1.1,h1:PZMS9lhjK9VytzMCW3tWHAXtKXmlURSc3ZdvwEcKCzw=,60ea73fa42536178798c3d4a36c5f9cffb185b6c1629c23c3faff5919f9e9cad
+github.com/libp2p/go-libp2p-yamux,v0.2.1,h1:Q3XYNiKCC2vIxrvUJL+Jg1kiyeEaIDNKLjgEjo3VQdI=,849f0097fd7203b5c6d590463b7fb17573af8d12136413768706188a39b34b21
+github.com/libp2p/go-maddr-filter,v0.0.5,h1:CW3AgbMO6vUvT4kf87y4N+0P8KUl2aqLYhrGyDUbLSg=,19c76e021879aab85a8858b53d706220e9e3277a96dead161db152f5a1d17219
+github.com/libp2p/go-mplex,v0.1.0,h1:/nBTy5+1yRyY82YaO6HXQRnO5IAGsXTjEJaR3LdTPc0=,3340a423ea89310360810973a77a97c217fe7b35e1c18189a3628e35fe1275e0
+github.com/libp2p/go-msgio,v0.0.4,h1:agEFehY3zWJFUHK6SEMR7UYmk2z6kC3oeCM7ybLhguA=,ec22f703203a2a443c57896b2082c02fe9c54d372aad091cdca144709d244721
+github.com/libp2p/go-nat,v0.0.3,h1:l6fKV+p0Xa354EqQOQP+d8CivdLM4kl5GxC1hSc/UeI=,d642c9dd697176ec69c4a5faeff1fc3b5472ef9f32c2c40e21c42f81ceef86b9
+github.com/libp2p/go-openssl,v0.0.3,h1:wjlG7HvQkt4Fq4cfH33Ivpwp0omaElYEi9z26qaIkIk=,f2eb05d710fe960ba12d5f640cefe7d31d24f1fab0d9a52faf5f2923a19c6f13
+github.com/libp2p/go-reuseport,v0.0.1,h1:7PhkfH73VXfPJYKQ6JwS5I/eVcoyYi9IMNGc6FWpFLw=,274ade934c7f26ffae86d3f4d34352371c3eca7ead080392f6f35698ec5f0a3f
+github.com/libp2p/go-reuseport-transport,v0.0.2,h1:WglMwyXyBu61CMkjCCtnmqNqnjib0GIEjMiHTwR/KN4=,866f45bfa6c2e65d563955a28050bcfbc6ed11df6ded7c551e92ff98ba98a2d8
+github.com/libp2p/go-stream-muxer,v0.1.0,h1:3ToDXUzx8pDC6RfuOzGsUYP5roMDthbUKRdMRRhqAqY=,d42dab9fb102b3e56cc555eb9aacb742e4230120dd356078cc723f8817200d43
+github.com/libp2p/go-stream-muxer-multistream,v0.2.0,h1:714bRJ4Zy9mdhyTLJ+ZKiROmAFwUHpeRidG+q7LTQOg=,a4ca5d0422d55ee7b4e74b040ca85799365b05684b7b6687adfa79a345049a9d
+github.com/libp2p/go-tcp-transport,v0.1.1,h1:yGlqURmqgNA2fvzjSgZNlHcsd/IulAnKM8Ncu+vlqnw=,147dc8d50aab944666c1a7a371ba3e351480506313be298ebf8dcdb9dc51b1b4
+github.com/libp2p/go-testutil,v0.1.0,h1:4QhjaWGO89udplblLVpgGDOQjzFlRavZOjuEnz2rLMc=,9fa6fa5741f541a6309e8a5fa6031c51f97fcd3086fe3a3b371b74f9d8e9a4b8
+github.com/libp2p/go-ws-transport,v0.1.0,h1:F+0OvvdmPTDsVc4AjPHjV7L7Pk1B7D5QwtDcKE2oag4=,30cfd8011bb8de03c23680d2249120ea9ba29879e855ca5c35311f8fa874d094
+github.com/libp2p/go-yamux,v1.2.3,h1:xX8A36vpXb59frIzWFdEgptLMsOANMFq2K7fPRlunYI=,97947a07c9430184c3be45e87580abcdea18c9b7435adb8048b08aebce0fea50
+github.com/liggitt/tabwriter,v0.0.0-20181228230101-89fcab3d43de,h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=,41b6869255915ffdfd32575ba14d52732d62d34b47d904df4890e165489ec77d
+github.com/linkedin/goavro,v2.1.0+incompatible,h1:DV2aUlj2xZiuxQyvag8Dy7zjY69ENjS66bWkSfdpddY=,25d4ccde4ece770196fbf6f09ca4184df581944224be5d64a263eb2c7f9a24fc
+github.com/linode/linodego,v0.10.0,h1:AMdb82HVgY8o3mjBXJcUv9B+fnJjfDMn2rNRGbX+jvM=,4c4e8829c0290c473e36bacdce8b490833d1f6247b1a4290062db30ba2b21568
+github.com/liquidweb/liquidweb-go,v1.6.0,h1:vIj1I/Wf97fUnyirD+bi6Y63c0GiXk9nKI1+sFFl3G0=,19e08fe2aa62655eb3cb209b37d532a267dd3078e5d262c4c45e7e09134b079c
+github.com/lithammer/dedent,v1.1.0,h1:VNzHMVCBNG1j0fh3OrsFRkVUwStdDArbgBWoPAffktY=,4ec56a3fef0d7dd1536046e540827e60419a935dde49d87d21f5856174cadba2
+github.com/logrusorgru/aurora,v0.0.0-20180419164547-d694e6f975a9,h1:KQdwUNlTDGyS6e+2rjAxfHSpBFIOHXqgDceNDqb55+4=,3b9d5caeede8553ead48405de57cd25bf6276b12531dae582c3ee089474aaf95
+github.com/loov/hrtime,v0.0.0-20181214195526-37a208e8344e,h1:UC+nLCm+w3WL+ibAW/wsWbQC3KAz7LLawR2hgX0eR9s=,f077796a9f39c579d356ac8f99831c56b3b2c52b70526f97730eccdc5ce558b2
+github.com/loov/plot,v0.0.0-20180510142208-e59891ae1271,h1:51ToN6N0TDtCruf681gufYuEhO9qFHQzM3RFTS/n6XE=,eb57dc24113d92cda1d0eecd6280603a2f1a98eececde895db4b060a7208659a
+github.com/lovoo/gcloud-opentracing,v0.3.0,h1:nAeKG70rIsog0TelcEtt6KU0Y1s5qXtsDLnHp0urPLU=,7bead4937d23976e07caf4bf7a7f302724cda9155aa8ac4de7baa2e10976eacc
+github.com/lsegal/gucumber,v0.0.0-20180127021336-7d5c79e832a2,h1:Gg0dt1q5bB+3R3qu+BucR+1f5ZhKm3OzPPo53dZ3Hxs=,2e5cd235f8c80ae078b3115b41fb765682c796d62fa54ecbb2096b159b0294bd
+github.com/lucas-clemente/aes12,v0.0.0-20171027163421-cd47fb39b79f,h1:sSeNEkJrs+0F9TUau0CgWTTNEwF23HST3Eq0A+QIx+A=,074a3c40044c8f07dbe93129fe30bfd4a12f6283f393e7300664d59924a8af2b
+github.com/lucas-clemente/quic-clients,v0.1.0,h1:/P9n0nICT/GnQJkZovtBqridjxU0ao34m7DpMts79qY=,b916edbd87d45fd375b0f81f905453102eb4e7e724ca0fc8ac5be323fe5958b8
+github.com/lucas-clemente/quic-go,v0.12.1,h1:BPITli+6KnKogtTxBk2aS4okr5dUHz2LtIDAP1b8UL4=,144443ffb6231cabbe6da1496c5851eb73f03fff33d7bd94aa394f8d1e3c73b3
+github.com/lucas-clemente/quic-go-certificates,v0.0.0-20160823095156-d2f86524cced,h1:zqEC1GJZFbGZA0tRyNZqRjep92K5fujFtFsu5ZW7Aug=,d9eff929a62711fc36f9655008e144863cd816ad2b59d25eb00a248c96178ce5
+github.com/lucasb-eyer/go-colorful,v1.0.2,h1:mCMFu6PgSozg9tDNMMK3g18oJBX7oYGrC09mS6CXfO4=,c0e388db91f217be87f8d508ac9f495adc5a33ffda78849e2d0a89a8e8dae28c
+github.com/lunixbochs/struc,v0.0.0-20190916212049-a5c72983bc42,h1:PzBD7QuxXSgSu61TKXxRwVGzWO5d9QZ0HxFFpndZMCg=,8a7db31161ec3a3bcc7b52e25975d0299b9c0bb465f076014d303f112b5cb9e1
+github.com/lunixbochs/vtclean,v1.0.0,h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8=,4d73f9678abde21c67dd8cb4ed8d7f63bcdd9413b6093b53cec4d26ce1be5b88
+github.com/lunny/dingtalk_webhook,v0.0.0-20171025031554-e3534c89ef96,h1:uNwtsDp7ci48vBTTxDuwcoTXz4lwtDTe7TjCQ0noaWY=,b94d4c7cacca0c289b3fbbeae6cc9e66f2eec4a3210fbbfd208316337ff2f1e3
+github.com/lunny/levelqueue,v0.0.0-20190217115915-02b525a4418e,h1:GSprKUrG9wNgwQgROvjPGXmcZrg4OLslOuZGB0uJjx8=,8f62ece23811c3c2be0d1c8d10057ab564641b2f73dc5a9910dd5f8462954f19
+github.com/lunny/log,v0.0.0-20160921050905-7887c61bf0de,h1:nyxwRdWHAVxpFcDThedEgQ07DbcRc5xgNObtbTp76fk=,0d551b83dcb0c4a3e0f97febf74e8f69b58a419791e217a7d2fd3d79a1e5877b
+github.com/lunny/nodb,v0.0.0-20160621015157-fc1ef06ad4af,h1:UaWHNBdukWrSG3DRvHFR/hyfg681fceqQDYVTBncKfQ=,a0f6632294f1eec60e2651fa2d4b3590f3a1a8e2f7692dcc77251b945906a701
+github.com/lusis/go-artifactory,v0.0.0-20160115162124-7e4ce345df82,h1:wnfcqULT+N2seWf6y4yHzmi7GD2kNx4Ute0qArktD48=,487d2ef1720bd49c5a36efc8893fdb0a76bd5f8b064c2a98974a78b3e35f5763
+github.com/lusis/go-slackbot,v0.0.0-20180109053408-401027ccfef5,h1:AsEBgzv3DhuYHI/GiQh2HxvTP71HCCE9E/tzGUzGdtU=,0bb7feaeb5a4e83486234c1c8fbe2f73b94213f511aaf6b8ef1f0fc96dd7b4fa
+github.com/lusis/outputter,v0.0.0-20171130132426-5a3b464a163f,h1:JY0YSH+YvMGmq83g5qILMAkJDFv7qIiHalhlQXal9V0=,e3b54ad36707730681b10a3838d89c346bf2d2c52cb61a241b178bcb0fc96e0f
+github.com/lusis/slack-test,v0.0.0-20190426140909-c40012f20018,h1:MNApn+Z+fIT4NPZopPfCc1obT6aY3SVM6DOctz1A9ZU=,019aa5a65d7fc369730c089a8af985f8d4760297a0058dd0c352fb662e8a0cfc
+github.com/lyft/protoc-gen-star,v0.4.11,h1:zW6fJQBtCtVeSiO/Kbpzv32GO0J/Z8egSLeohES202w=,673c0c53ce301a5589d4aab2b389c6ab52c8312193bae9b491e75e4938475277
+github.com/lyft/protoc-gen-validate,v0.1.0,h1:NytKd9K7UW7Szxn+9PYNsaJ/98TL/WsDq4ro4ZVuh5o=,2e452d4298aa5f2be8d4eda3e55522a4c020d0f23dac6b33ecf9942be09bf082
+github.com/magefile/mage,v1.4.0,h1:RI7B1CgnPAuu2O9lWszwya61RLmfL0KCdo+QyyI/Bhk=,55862155e89367536d665080ac028decc98ce68c5651ccc4238d7e34ddf1cbc2
+github.com/magiconair/properties,v1.8.1,h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=,c0f0378f5949db2e7976d6822a0dfac1786acd34190e83ab253d6505542d0128
+github.com/mailgun/mailgun-go,v0.0.0-20171127222028-17e8bd11e87c,h1:5huPh/MfWW65cx8KWNVD4mCCnwIrNiX4bFJR5OeONg0=,33250edd00795e387f2de671003b8ef8f2d940d24b12a9ce90c6b49dd6094231
+github.com/mailgun/minheap,v0.0.0-20170619185613-3dbe6c6bf55f,h1:aOqSQstfwSx9+tcM/xiKTio3IVjs7ZL2vU8kI9bI6bM=,26930b2a6dc2f2b442e28ecc5dcbb22c2e7da3d151b3388d0bc604370bd9df77
+github.com/mailgun/multibuf,v0.0.0-20150714184110-565402cd71fb,h1:m2FGM8K2LC9Zyt/7zbQNn5Uvf/YV7vFWKtoMcC7hHU8=,7dbb280e8bc981732510ee72e124e931991d06c317531de709fd7922e38a5339
+github.com/mailgun/timetools,v0.0.0-20170619190023-f3a7b8ffff47,h1:jlyJPTyctWqANbaxi/nXRrxX4WeeAGMPaHPj9XlO0Rw=,a4d961cefbfbe858f4ba5a5824d91ad8713a736707f5c259cf0d7307a07ac83e
+github.com/mailgun/ttlmap,v0.0.0-20170619185759-c1c17f74874f,h1:ZZYhg16XocqSKPGNQAe0aeweNtFxuedbwwb4fSlg7h4=,35308e95ed02635049d1804b85f16407f3109fc60c38df541f0401dbba66dc8d
+github.com/mailru/easyjson,v0.7.0,h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM=,c36c8ab36aab9ba2ca776d1c71cbd9c30fce7c4e8e62be6611f4c2d1e98e86ae
+github.com/manucorporat/sse,v0.0.0-20160126180136-ee05b128a739,h1:ykXz+pRRTibcSjG1yRhpdSHInF8yZY/mfn+Rz2Nd1rE=,cd90f350cca3a6536432afb4cd2355ff25124ef89fc23a52392e5189733b0359
+github.com/manveru/faker,v0.0.0-20171103152722-9fbc68a78c4d,h1:Zj+PHjnhRYWBK6RqCDBcAhLXoi3TzC27Zad/Vn+gnVQ=,80bc3e8ca50e89d3a6139d1709fbf4680c26231079d297d237902d3c23f4c1e8
+github.com/manveru/gobdd,v0.0.0-20131210092515-f1a17fdd710b,h1:3E44bLeN8uKYdfQqVQycPnaVviZdBLbizFhU49mtbe4=,39811c3d6c7de66195a29a78b235dead57fb866e61082301fe68d51cf04a5200
+github.com/markbates/deplist,v1.3.0,h1:uPgoloPraPBPYtNSxj2UwZBh2EHW9TmMvQCP2FBiRlU=,e0b1903fb33c324721565076e2061d7f54e29ba098afb80af4fe2ccdd02ed178
+github.com/markbates/going,v1.0.3,h1:mY45T5TvW+Xz5A6jY7lf4+NLg9D8+iuStIHyR7M8qsE=,61efe687a56d3141284be7bdb83bb5ae86e1df694ababa5937c4d3e30f3b60f1
+github.com/markbates/goth,v1.49.0,h1:qQ4Ti4WaqAxNAggOC+4s5M85sMVfMJwQn/Xkp73wfgI=,39a0244d07f47d7b91215590900a7754c4700e875c0866b1e65568133471478a
+github.com/markbates/grift,v1.1.0,h1:DsljFKUSK1ELpU22ZE+Gi93jiQI3cYD/RQ+vHM/PpY8=,29aa2fa782f9d8730bde2df024c40ba749f1812dd3bbab489b4197a1faa78627
+github.com/markbates/hmax,v1.1.0,h1:MswE0ks4Iv1UAQNlvAyFpsyFQSBHolckas95gRUkka4=,8c7557798a88c74594f27137be859e99195427e2e04f0835f48781b0bde5c73a
+github.com/markbates/inflect,v1.0.4,h1:5fh1gzTFhfae06u3hzHYO9xe3l3v3nW5Pwt3naLTP5g=,0da6e75f6cd27672255a41f5dfab418d2746897239ad601e5d8d78d6354b5665
+github.com/markbates/oncer,v1.0.0,h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY=,9a774885bfa4c9a96c438fdb51768833e1c7003f35cd27961137ff4096b1a764
+github.com/markbates/refresh,v1.8.0,h1:ELMS9kKyO/H6cJrqFo6qCyE0cRx2JeHWC9yusDkVeM8=,7ac81390a898cfd1cdc097ffb1e05321c415183165b7341749de41160c47e504
+github.com/markbates/safe,v1.0.1,h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI=,d5a98e8242318d4e88844ddbbfebe91f67f41e5aa1f6a96a58fa2fa94e0ae9ef
+github.com/markbates/sigtx,v1.0.0,h1:y/xtkBvNPRjD4KeEplf4w9rJVSc23/xl+jXYGowTwy0=,e3b591a1a2b4dcec7b86d59e504b0bbf87ec3663efad818cd9b00471a33a0345
+github.com/markbates/willie,v1.0.9,h1:394PpHImWjScL9X2VRCDXJAcc77sHsSr3w3sOnL/DVc=,a6c3eda44d765eeb1370b0ddeb739df86e900b78eb365688da143f1c0c0e9bc0
+github.com/marstr/guid,v1.1.0,h1:/M4H/1G4avsieL6BbUwCOBzulmoeKVP5ux/3mQNnbyI=,7db3cd8020c72ba260d1a20183bf5a030c696d6442eccaff2b31f72b194fc571
+github.com/marten-seemann/qpack,v0.1.0,h1:/0M7lkda/6mus9B8u34Asqm8ZhHAAt9Ho0vniNuVSVg=,46c42087e554edae4e19f79b785722d27316e23278889bf78a0c8f43fc387f2e
+github.com/marten-seemann/qtls,v0.3.2,h1:O7awy4bHEzSX/K3h+fZig3/Vo03s/RxlxgsAk9sYamI=,ff5245b3d5a1e65754d4a740e09ff02c738e9043c6e2bc02c59d5851c1fc1e2d
+github.com/martini-contrib/render,v0.0.0-20150707142108-ec18f8345a11,h1:YFh+sjyJTMQSYjKwM4dFKhJPJC/wfo98tPUc17HdoYw=,2edd7f64b2f1f053f86a51856cd0f02b1f762af61a458a2e282dab76ad093d70
+github.com/martinlindhe/unit,v0.0.0-20190604142932-3b6be53d49af,h1:4bEyeobv/dO+lT1Qp1hr+/DcNjy6Ob8BDaSrxX6nQsQ=,ee5001e908fb9997e5918c909dcb0cc078f1a91719f4df3d62243d5e88dc07c6
+github.com/martinusso/go-docs,v0.0.0-20161215163720-81905d575a58,h1:VmcrkkMjTdCGOsuuMnn7P2X9dGh3meUNASx6kHIpe7A=,70ad43a3172287882f904657184af77133a578c6d1ec968c5ce3e27259100a06
+github.com/maruel/panicparse,v0.0.0-20171209025017-c0182c169410,h1:1ROIrlLvFoHKX+i48KdRauq21irSOXPyfQw4T/PrINY=,5fd98b2b0a8346ffcba1858775e93db0582ead6b3329b974595d5ab448c95f28
+github.com/maruel/ut,v1.0.0,h1:Tg5f5waOijrohsOwnMlr1bZmv+wHEbuMEacNBE8kQ7k=,a7c90a5020071c66efe2ccae7f3859c60f17840d4ae2972ee9c9a38ae071fb3e
+github.com/masterzen/azure-sdk-for-go,v0.0.0-20161014135628-ee4f0065d00c,h1:FMUOnVGy8nWk1cvlMCAoftRItQGMxI0vzJ3dQjeZTCE=,de40198aee773ecaf502d59b8f29fe5d1564fb9a68900b6bfed2369e169e193a
+github.com/masterzen/simplexml,v0.0.0-20190410153822-31eea3082786,h1:2ZKn+w/BJeL43sCxI2jhPLRv73oVVOjEKZjKkflyqxg=,a9e4548a5c7e098c89273c470e4e9d18cb0beb530629f2e512f6f105fd9cbc88
+github.com/masterzen/winrm,v0.0.0-20190223112901-5e5c9a7fe54b,h1:/1RFh2SLCJ+tEnT73+Fh5R2AO89sQqs8ba7o+hx1G0Y=,28f8e69baadf7f220842a5cd4269ccebdb175a835c0b43819a6b15670ae5403c
+github.com/matryer/moq,v0.0.0-20190312154309-6cfb0558e1bd,h1:HvFwW+cm9bCbZ/+vuGNq7CRWXql8c0y8nGeYpqmpvmk=,b9fb2bc3d0894dfaa3cc4298f49c97346ccb66f2f0e6911f4f224ffc9acc3972
+github.com/matryer/try,v0.0.0-20161228173917-9ac251b645a2,h1:JAEbJn3j/FrhdWA9jW8B5ajsLIjeuEHLi8xE4fk997o=,f1afa36a4bd0bf09a1290f3afef954058e334d6b275aae6a591d8dad276f5e2f
+github.com/mattbaird/elastigo,v0.0.0-20170123220020-2fe47fd29e4b,h1:v29yPGHhOqw7VHEnTeQFAth3SsBrmwc8JfuhNY0G34k=,f6a94deccbe4d008d265bb4b5cbaee7893e5994a82bc49b44438675a0ca8d8f3
+github.com/mattbaird/jsonpatch,v0.0.0-20171005235357-81af80346b1a,h1:+J2gw7Bw77w/fbK7wnNJJDKmw1IbWft2Ul5BzrG1Qm8=,55abaf4d26d8ad7f81c230f38a6e482b6b416d9b5777a6c3b1a5c140465a5235
+github.com/mattermost/mattermost-server,v5.11.1+incompatible,h1:LPzKY0+2Tic/ik67qIg6VrydRCgxNXZQXOeaiJ2rMBY=,1f601d79e647a248f9e711891e015b1709f3af37e6a45d5e97827f074c40398e
+github.com/mattn/go-colorable,v0.1.4,h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=,02ad42bc54adf7c52030b6ab903277af8fb7163aad4f7f8d8703ecfdc62597de
+github.com/mattn/go-ieproxy,v0.0.0-20190805055040-f9202b1cfdeb,h1:hXqqXzQtJbENrsb+rsIqkVqcg4FUJL0SQFGw08Dgivw=,5914c18852b0be63008f7ccaf1bd3a8214a82fae78f8afe2e7d774ff96a410ff
+github.com/mattn/go-isatty,v0.0.10,h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10=,dca893515dccb58e21f9b08837470c5512e0ecd1275767ed996912bb46933c91
+github.com/mattn/go-mastodon,v0.0.5-0.20190517015615-8f6192e26b66,h1:TbnaLJhq+sFuqZ1wxdfF5Uk7A2J41iOobCCFnLI+RPE=,b290b77b6e5556bba70cf18ac815c13ed9a80ffa4cb03627d73187e99cd15d42
+github.com/mattn/go-oci8,v0.0.0-20190320171441-14ba190cf52d,h1:m+dSK37rFf2fqppZhg15yI2IwC9BtucBiRwSDm9VL8g=,eb3bd1fa93c8a341ad43176cb6e4d8540d7a91d3edd7eb98c1388cf2f4c3515c
+github.com/mattn/go-runewidth,v0.0.5,h1:jrGtp51JOKTWgvLFzfG6OtZOJcK2sEnzc/U+zw7TtbA=,3b34033634b059bfa31ac552d2150d8c0d6e530dd1c0ead2ce0806e1d7cc754a
+github.com/mattn/go-shellwords,v1.0.6,h1:9Jok5pILi5S1MnDirGVTufYGtksUs/V2BWUP3ZkeUUI=,374285b205f0659ab4be3f8ce346cfd3291cd42f47b12bda15174c42c462b1a6
+github.com/mattn/go-sqlite3,v1.11.0,h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q=,7fec79c50206f5faa759d1b64500fb0d082e22ef23f10e2d4cbce24e4fc2d5c1
+github.com/mattn/go-tty,v0.0.0-20190424173100-523744f04859,h1:smQbSzmT3EHl4EUwtFwFGmGIpiYgIiiPeVv1uguIQEE=,76f28f59927667d2d750fa6ffdefeb3f0c41034cb593e4545a206995c76c619f
+github.com/mattn/go-xmpp,v0.0.0-20190124093244-6093f50721ed,h1:A1hEQg5M0b3Wg06pm3q/B0wdZsPjVQ/a2IgauQ8wCZo=,2c39b78184ea27890be56f593353c8fe6b3d6efa53db20e800ff8793bc665199
+github.com/mattn/go-zglob,v0.0.1,h1:xsEx/XUoVlI6yXjqBK062zYhRTZltCNmYPx6v+8DNaY=,8decd6c1916188ab4fa1001e3da3f22d7c9fb6218215fd25053c901979930feb
+github.com/mattn/goveralls,v0.0.2,h1:7eJB6EqsPhRVxvwEXGnqdO2sJI0PTsrWoTMXEk9/OQc=,3df5b7ebfb61edd9a098895aae7009a927a2fe91f73f38f48467a7b9e6c006f7
+github.com/matttproud/golang_protobuf_extensions,v1.0.1,h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=,e64dc58023f4b8c4472d05a44f2719b84d6c2cc364cc682820c9f72b233c9cdc
+github.com/maxbrunsfeld/counterfeiter/v6,v6.2.2,h1:g+4J5sZg6osfvEfkRZxJ1em0VT95/UOZgi/l7zi1/oE=,c185793a7e749ff2557f4557628f5b5d8d9edbf72ca6bd2cb94503f4817c01d2
+github.com/mcuadros/go-version,v0.0.0-20190830083331-035f6764e8d2,h1:YocNLcTBdEdvY3iDK6jfWXvEaM5OCKkjxPKoJRdB3Gg=,ff2364bda8605ad94051c576ffa601e1a9aedabc8a1fda588eb04c3371a845ea
+github.com/mdlayher/dhcp6,v0.0.0-20190311162359-2a67805d7d0b,h1:r12blE3QRYlW1WBiBEe007O6NrTb/P54OjR5d4WLEGk=,fba7b2f01311e2d41bb4ebe15409d4e0a605a79d2f05156bb0f4adbc20f557bc
+github.com/mdlayher/netlink,v0.0.0-20191009155606-de872b0d824b,h1:W3er9pI7mt2gOqOWzwvx20iJ8Akiqz1mUMTxU6wdvl8=,9be201b393fe866f855e5ebb20ef33e86a0e6a99b6b76209531b93615fcbac7c
+github.com/mesos/mesos-go,v0.0.10,h1:+M/7Zlkvw4MolkLvXHfj6hkDsLLHOOU54CmOkOUaNBc=,f18d5601dc6a5234b9c2d65cb96b8d30ab877e3117dd52dd47e31a353ed887d1
+github.com/mgutz/ansi,v0.0.0-20170206155736-9520e82c474b,h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=,d7c0ff88c53dfca384bb82108a6e5fdc9e11b358d68b67144ff6a285be20a16a
+github.com/mgutz/logxi,v0.0.0-20161027140823-aebf8a7d67ab,h1:n8cgpHzJ5+EDyDri2s/GC7a9+qK3/YEGnBsd0uS/8PY=,0a7837d5246591fe1fd341e48a72786c0b61fff8d3ebfea0e9c789176c3e75d5
+github.com/mgutz/str,v1.2.0,h1:4IzWSdIz9qPQWLfKZ0rJcV0jcUDpxvP4JVZ4GXQyvSw=,bf640c2048957f183e72664ff08745ae3d016f64072a5967f5269ccb5fc4b318
+github.com/mholt/archiver,v3.1.1+incompatible,h1:1dCVxuqs0dJseYEhi5pl7MYPH9zDa1wBi7mF09cbNkU=,6cbad83ecd8a2bcb013fb1ac163a6551e6f948b103df9b258788612c72551184
+github.com/mholt/certmagic,v0.7.5,h1:1ZGHwUI4+zg1S17tPUj5Xxb9Q1ghTjLcUZE5G4yV5SM=,a85c14ecbb135636c8e4701a25b8d2884f091d948269c0a3187918af83e11db3
+github.com/michaelklishin/rabbit-hole,v1.5.0,h1:Bex27BiFDsijCM9D0ezSHqyy0kehpYHuNKaPqq/a4RM=,1fdb62e985c4b1be24632875668720ed687455ece54cb2c77079488784e06e69
+github.com/micro-plat/gmq,v1.0.1,h1:ai1PiCEfgBmiqzmZ4iWE3l2Vuz7rOTWOakqRWqi/Hgo=,63c4a02b87b31c0f5cfcdfee5df2fa05e77eeaa2aab93b0ef217c57f6b37b38a
+github.com/micro-plat/lib4go,v0.2.1,h1:NBTIq0DvpRzTChnYShBagPmsYM4k1NgvkE8OYhgMDt8=,ae1056cc76eee3fccb14b0d8723b6444d8f31d2575a0caa1d3723bc54b91496b
+github.com/micro/cli,v0.2.0,h1:ut3rV5JWqZjsXIa2MvGF+qMUP8DAUTvHX9Br5gO4afA=,09e532e4616aa7827d1a1f249bc80ebb01fe8c63978f4b14605246c6be596b82
+github.com/micro/go-log,v0.1.0,h1:szYSR+yyTsomZM2jyinJC5562DlqffSjHmTZFaeZ2vY=,5ec9ba1cfb781edd3695dc9c28afb520cced5e1cf7eabb5faafd4bd8db6953ea
+github.com/micro/go-micro,v1.14.0,h1:lptn9DBbsNCB3RC3PMwxTJGqCUgU8Rf23nAMaRuOcOA=,2278cfa86f7bf97df81ea79535127cf87bf03aba29e7603f2feeb48b2d1a3334
+github.com/micro/go-rcache,v0.2.0,h1:g51QJW+lj+dAOXwRlYNZPQQ8ueHLptgoUzZE3iRwJMg=,fa96add40dac8fb14cf08f7a8c96d05c902da40b27b2c4e586cf3304e4ef6533
+github.com/micro/h2c,v1.0.0,h1:ejw6MS5+WaUoMHRtqkVCCrrVzLMzOFEH52rEyd8Fl2I=,6fea0303cbaa2bc6c45098ce5ad0ae2aa7f9c54ce2ff90160549756f8c7a2b07
+github.com/micro/mdns,v0.3.0,h1:bYycYe+98AXR3s8Nq5qvt6C573uFTDPIYzJemWON0QE=,a40ecbd32a2170698f0f49f8961b39e88e7c3e958546a401a59653231b51f1b2
+github.com/micro/micro,v1.14.0,h1:Uol1+Yg5frzneACpzoHEDsyNTN+/+yLrlGMuxR3RVRQ=,0fd330788ad610cc2cb3eb2224f1ca403d9888ad40e78628f250c885373d739c
+github.com/micro/util,v0.2.0,h1:6u0cPj1TeixEk5cAR9jbcVRUWDQsmCaZvDBiM3zFZuA=,3e61d5232a3a91d521ade483ab64b53a7b8760d0635978d72b4920eba52f8f79
+github.com/microcosm-cc/bluemonday,v1.0.2,h1:5lPfLTTAvAbtS0VqT+94yOtFnGfUWYyx0+iToC3Os3s=,9cfac37098da75ab1c278740e8f0f7741891d8843e14afb256574596ad786f83
+github.com/miekg/dns,v1.1.22,h1:Jm64b3bO9kP43ddLjL2EY3Io6bmy1qGb9Xxz6TqS6rc=,54f1f62de314150df163bbe1de91acc922cdce70c5c8a43dfeb7f4af24711d38
+github.com/miekg/mmark,v1.3.6,h1:t47x5vThdwgLJzofNsbsAl7gmIiJ7kbDQN5BxwBmwvY=,8d1b05ee1c0a28093c678af2ed9d0aac9dfc30dce728ccd21fe1506762b54cee
+github.com/mindprince/gonvml,v0.0.0-20190828220739-9ebdce4bb989,h1:PS1dLCGtD8bb9RPKJrc8bS7qHL6JnW1CZvwzH9dPoUs=,6702f94187c4e2994ffbdc318c94a04d4bc67081a402e968a2c362a74c81263f
+github.com/minio/blake2b-simd,v0.0.0-20160723061019-3f5f724cb5b1,h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g=,ab10edfe994b513e2d03cdd8122b352f31a1eb246fe884617b3f2f6195a3ca0c
+github.com/minio/cli,v1.22.0,h1:VTQm7lmXm3quxO917X3p+el1l0Ca5X3S4PM2ruUYO68=,33533a4e0a2b1a698d0f899cb5b84d9fc199e7723b971d1408e4b5ee797c9a50
+github.com/minio/dsync,v0.0.0-20180124070302-439a0961af70,h1:pRHQdPOlUhelWqNUF3icFrBSC6VYH1hvF6HigVfgMoI=,850e5b400afc4301a1860debf934c5e8e67565d4937ac45f9a37132b31a09941
+github.com/minio/highwayhash,v0.0.0-20180501080913-85fc8a2dacad,h1:L+8skVz2lusCbtlalLXmJp+TK8XaGAsZ3utSC3k5Jc0=,7393dfe736668f9ab98fcf2d264f9bd20bbf4f98538f02ff15df9604f747cdb1
+github.com/minio/lsync,v0.0.0-20180328070428-f332c3883f63,h1:utJHim4C0K4CmD+Qgod/tgHvo7QNOlH6HN5O8QUvPEI=,417c4bdd4fc5d50da2d81e8890b03af4b80ce9fbd5e4c196731a3d76a09913c1
+github.com/minio/mc,v0.0.0-20180926130011-a215fbb71884,h1:co3kRW9cEI65yolYtcLcNxp2a9yk5T/eEt7gw14tJVs=,37300de5179e1085559c6f317b331d261cc4508ba0e4febbd93cbbfef42d7fc9
+github.com/minio/minio,v0.0.0-20180508161510-54cd29b51c38,h1:F7p0ZU9AQuxlA6SWwhXr0H/rYrA9fOiBk2OzOj7GtfM=,6421e5cf72b35a2948e5edd2b189f37ad1896b8637d5b9bcf7cd40b7ab63dfd4
+github.com/minio/minio-go,v6.0.14+incompatible,h1:fnV+GD28LeqdN6vT2XdGKW8Qe/IfjJDswNVuni6km9o=,3bc396d5e1c0c6f3497743140eaf16ebb97c5f1ca815ba12c4f431e804fb737d
+github.com/minio/minio-go/v6,v6.0.27-0.20190529152532-de69c0e465ed,h1:g3DRJpu22jEjs14fSeJ7Crn9vdreiRsn4RtrEsXH/6A=,34d85b6b915ef5876f9c262f260583fabec147c37dcb82e1f42374dd088b9096
+github.com/minio/sha256-simd,v0.1.1,h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU=,0ecfa6532265e139d5d9406c0a803c7ef45b1d8d0f0c1b1d55f7b81969294bfc
+github.com/minio/sio,v0.0.0-20180327104954-6a41828a60f0,h1:ys4bbOlPvaUBlA0byjm6TqydsXZu614ZIUTfF+4MRY0=,6c46bc4a68353d7b41f6e91eb276c9b21560cad4f75419baaee01764927fb7e8
+github.com/mistifyio/go-zfs,v2.1.1+incompatible,h1:gAMO1HM9xBRONLHHYnu5iFsOJUiJdNZo6oqSENd4eW8=,545764e34ed40473380ea1b08af9f0aea1715d15a0a56fc937e6c3b1bda0d9a3
+github.com/mitchellh/cli,v1.0.0,h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y=,74199f2c2e1735a45e9f5c2ca049d352b0cc73d945823540e54ca9975ce35752
+github.com/mitchellh/colorstring,v0.0.0-20190213212951-d06e56a500db,h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=,d0733284b20567055e374b420373f5508fa47e95204e59e4b8a66834e7e3964d
+github.com/mitchellh/copystructure,v1.0.0,h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=,4a2c9eb367a7781864e8edbd3b11781897766bcf6120f77a717d54a575392eee
+github.com/mitchellh/go-fs,v0.0.0-20180402234041-7b48fa161ea7,h1:PXPMDtfqV+rZJshQHOiwUFqlqErXaAcuWy+/ZmyRfNc=,21c34fee3df3dc1ddad5e774ddf9e05998061177420709fb68a958c6c113a90b
+github.com/mitchellh/go-homedir,v1.1.0,h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=,fffec361fc7e776bb71433560c285ee2982d2c140b8f5bfba0db6033c0ade184
+github.com/mitchellh/go-linereader,v0.0.0-20190213213312-1b945b3263eb,h1:GRiLv4rgyqjqzxbhJke65IYUf4NCOOvrPOJbV/sPxkM=,7b83ef857c71fe8d4937b57923923176dd43c7b1b7632a9779bac411924e87e1
+github.com/mitchellh/go-ps,v0.0.0-20190716172923-621e5597135b,h1:9+ke9YJ9KGWw5ANXK6ozjoK47uI3uNbXv4YVINBnGm8=,06090b6c22dedf800259eb5d9b5f35bfb7b38e22888c0345631dc54366b21f89
+github.com/mitchellh/go-testing-interface,v1.0.0,h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0=,255871a399420cd3513b12f50738d290e251637deb23e21a4332192584ecf9c7
+github.com/mitchellh/go-vnc,v0.0.0-20150629162542-723ed9867aed,h1:FI2NIv6fpef6BQl2u3IZX/Cj20tfypRF4yd+uaHOMtI=,2d65ac584e1a17421265fe97f83bd1cbff447ca6a911fa8d91414fa2115e3e74
+github.com/mitchellh/go-wordwrap,v1.0.0,h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4=,9ea185f97dfe616da351b63b229a5a212b14ac0e23bd3f943e39590eadb38031
+github.com/mitchellh/gox,v1.0.1,h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI=,30a69e17ba5cafe6f1ac436bcc99368a5a34f0a0763926d2c6780a781f8e9e95
+github.com/mitchellh/hashstructure,v1.0.0,h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y=,3b79b07860631d05645ea3f54830b7e1997dbcf477e84a8adfe4979be3abdfde
+github.com/mitchellh/iochan,v1.0.0,h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY=,f3eede01adb24c22945bf71b4f84ae25e3744a12b9d8bd7c016705adc0d778b8
+github.com/mitchellh/mapstructure,v1.1.2,h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=,cd86d8586cbc333de28f6a46989069487877fae437df4c2cc417668d203c7305
+github.com/mitchellh/panicwrap,v0.0.0-20190213213626-17011010aaa4,h1:jw9tsdJ1FQmUkyTXdIF/nByTX+mMnnp16glnvGZMsC4=,b9ab07bbacf733cc24f9f7f53eec19f9bf999cbb35180ad0b615fe437640de6e
+github.com/mitchellh/pointerstructure,v0.0.0-20190430161007-f252a8fd71c8,h1:1CO5wil3HuiVLrUQ2ovSTO+6AfNOA5EMkHHVyHE9IwA=,658a3e14e4983f3c8a04c8da4a56d4d8a86e2b4fcaa6b1eefab150efcd742848
+github.com/mitchellh/prefixedio,v0.0.0-20190213213902-5733675afd51,h1:eD92Am0Qf3rqhsOeA1zwBHSfRkoHrt4o6uORamdmJP8=,d3209d88b3b5b05ecd48f469bc16811666f786685c49273664a5496d5dd69018
+github.com/mitchellh/reflectwalk,v1.0.1,h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE=,bf1d4540bf05ea244e65fca3e9f859d8129c381adaeebe7f22703959aadc4210
+github.com/mjibson/esc,v0.2.0,h1:k96hdaR9Z+nMcnDwNrOvhdBqtjyMrbVyxLpsRCdP2mA=,9f090786bd43dddb5c0d798b449d5e8aede4cb7d106f56dcac0aebd8fd1929cc
+github.com/mndrix/ps,v0.0.0-20131111202200-33ddf69629c1,h1:kCroTjOY+wyp+iHA2lZOV5aJ6WfBVjGnW8bCYmXmLPo=,30b12b7a2467d4a1aa64aa31c715cb45d570d36e31ae70719101d686363d2685
+github.com/mndrix/tap-go,v0.0.0-20171203230836-629fa407e90b,h1:Ga1nclDSe8gOw37MVLMhfu2QKWtD6gvtQ298zsKVh8g=,c6f65bd8d977e53fa083d9d0309cffb0dbfaaae69a5a64a352fb2f7d079ce73d
+github.com/modern-go/concurrent,v0.0.0-20180306012644-bacd9c7ef1dd,h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=,91ef49599bec459869d94ff3dec128871ab66bd2dfa61041f1e1169f9b4a8073
+github.com/modern-go/reflect2,v1.0.1,h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=,6af8268206d037428a4197bd421bbe5399c19450ef53ae8309a083f34fb7ac05
+github.com/mohae/deepcopy,v0.0.0-20170929034955-c48cc78d4826,h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=,41ba726508a213f4af89e7d58937263ff778e352d591edd422d3a3dc3272585c
+github.com/mongodb/grip,v0.0.0-20191008181606-ee248dc03622,h1:pPoJByX3B56ydhWGUMard1QQ2skLNTw/s1W5VuLLAtA=,08fcfea928382f428dc1fceeada1c264e7f6dc7256dbe05c5c0ba41dca16a42c
+github.com/monoculum/formam,v0.0.0-20190830100315-7ff9597b1407,h1:ZU5O9BawmEx9Mu1lxn9NLIwO9DrqRfjE+HWKU+e9GKQ=,5a04e3907fb1008c1e6640e8a0e9394c752aab4ebf7e3be01cd3ee55c2659121
+github.com/montanaflynn/stats,v0.5.0,h1:2EkzeTSqBB4V4bJwWrt5gIIrZmpJBcoIRGS2kWLgzmk=,05527945351f54f4e8c48666bce277fbace34026eed22ac7d88a50a6730767f1
+github.com/morikuni/aec,v1.0.0,h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=,c14eeff6945b854edd8b91a83ac760fbd95068f33dc17d102c18f2e8e86bcced
+github.com/moul/anonuuid,v0.0.0-20160222162117-609b752a95ef,h1:E/seV1Rtsnr2juBw1Dfz4iDPT3/5s1H/BATx+ePmSyo=,ec103e75b93231b5b858a2fc9985da39d6b7c35644a689a20e60f3a6ad6b1396
+github.com/moul/gotty-client,v0.0.0-20180327180212-b26a57ebc215,h1:y6FZWUBBt1iPmJyGbGza3ncvVBMKzgd32oFChRZR7Do=,265c4cbad4789e267f283b9012ad174c89e378e59ad9c64ac28729402eb60afe
+github.com/moul/http2curl,v0.0.0-20161031194548-4e24498b31db,h1:eZgFHVkk9uOTaOQLC6tgjkzdp7Ays8eEVecBcfHZlJQ=,2ff4e19b14d84f6d181afc79f28668c6171d6dea79c43a1918c0428a265137c1
+github.com/mozilla-services/heka,v0.10.0,h1:w+y6RPJkU6ZKeNbG1VvK9aSqJm0sru5TYcwOj6ejv8U=,f325891304f9acc654944d9a2297b8816a0a86440b2f035c4996ec38fcfa0eed
+github.com/mozillazg/go-cos,v0.12.0,h1:b9hUd5HjrDe10BUfkyiLYI1+z4M2kAgKasktszx9pO4=,5376eaf13e10fed6d73b713fbabc4a159d204239579120c410ea74de33dd6d71
+github.com/mozillazg/go-httpheader,v0.2.1,h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ=,50b7a36360fc1ec1a85fd40fe45f8db02fc734fc2af0514a60a068f0a2708122
+github.com/mozillazg/go-unidecode,v0.1.1,h1:uiRy1s4TUqLbcROUrnCN/V85Jlli2AmDF6EeAXOeMHE=,812d3bc9f03cb6a8552bfadd9e0d1b44a57807a3af2e8667a42861510bb2b20c
+github.com/mpvl/unique,v0.0.0-20150818121801-cbe035fff7de,h1:D5x39vF5KCwKQaw+OC9ZPiLVHXz3UFw2+psEX+gYcto=,af2bcc8a61a6881e0703afee2217dd1e75c8b34f4e49947c0d7f6e87af574e0e
+github.com/mr-tron/base58,v1.1.2,h1:ZEw4I2EgPKDJ2iEw0cNmLB3ROrEmkOtXIkaG7wZg+78=,c2b362db55d8266ce02a161b7f73cad646432d2dae98511385b88481380c4e86
+github.com/mreiferson/go-httpclient,v0.0.0-20160630210159-31f0106b4474,h1:oKIteTqeSpenyTrOVj5zkiyCaflLa8B+CD0324otT+o=,e94cbe43c052831323c59ff186c830ea2e271065f7f8b2794ade7aaf88a37a85
+github.com/mrjones/oauth,v0.0.0-20180629183705-f4e24b6d100c,h1:3wkDRdxK92dF+c1ke2dtj7ZzemFWBHB9plnJOtlwdFA=,4c1fef02b34241008ba6bc33fb5d01b4cfb3b7e7544fb7f70823fe74b9b21362
+github.com/mrunalp/fileutils,v0.0.0-20171103030105-7d4729fb3618,h1:7InQ7/zrOh6SlFjaXFubv0xX0HsuC9qJsdqm7bNQpYM=,c32d691ce15012ba21fbe69db3558df0c97326426c14ef747b8a1e02652ca7b3
+github.com/mschoch/smat,v0.0.0-20160514031455-90eadee771ae,h1:VeRdUYdCw49yizlSbMEn2SZ+gT+3IUKx8BqxyQdz+BY=,488e193897c7d8e3b3758cbeb8a5bc1b58b9619f3f14288a2ea9e0baa5ed9b3e
+github.com/msteinert/pam,v0.0.0-20151204160544-02ccfbfaf0cc,h1:z1PgdCCmYYVL0BoJTUgmAq1p7ca8fzYIPsNyfsN3xAU=,315d911c41d88a22bf8831b174bbd15310bc403626507095f98b9780ddcf9174
+github.com/muesli/smartcrop,v0.0.0-20180228075044-f6ebaa786a12,h1:l0X/8IDy2UoK+oXcQFMRSIOcyuYb5iEPytPGplnM41Y=,5857e4d0ed238d8c6f8f41294b98771f1c21874a80ea5f2e75b4a49cbcf1d3e0
+github.com/multiformats/go-base32,v0.0.3,h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI=,658875e4980370db6180f99835b3a48158a697eef69e7c3eb86b0b4f5c1c19ed
+github.com/multiformats/go-multiaddr,v0.1.1,h1:rVAztJYMhCQ7vEFr8FvxW3mS+HF2eY/oPbOMeS0ZDnE=,ba4849fc68453c3e812e850f40e6d5acef671060ed79f203c2d179d395d20fc5
+github.com/multiformats/go-multiaddr-dns,v0.0.2,h1:/Bbsgsy3R6e3jf2qBahzNHzww6usYaZ0NhNH3sqdFS8=,219f855f485aa198d36305f2f43012a73bd40f15caa3e606324cee9f117e5b89
+github.com/multiformats/go-multiaddr-fmt,v0.1.0,h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E=,d83537dc1f83185dfb60b190ea4b3c7b05c552a75ad7cfaddd0b987c00ff0cff
+github.com/multiformats/go-multiaddr-net,v0.1.1,h1:jFFKUuXTXv+3ARyHZi3XUqQO+YWMKgBdhEvuGRfnL6s=,241c47d621bcb9a40d33284f407a7fdf458cb3f87ef02db68735cc6b9002afed
+github.com/multiformats/go-multibase,v0.0.1,h1:PN9/v21eLywrFWdFNsFKaU04kLJzuYzmrJR+ubhT9qA=,ed39145efcf5e8c99deaa183071aed246239730f5781b291bad7de5d1fc12d81
+github.com/multiformats/go-multihash,v0.0.8,h1:wrYcW5yxSi3dU07n5jnuS5PrNwyHy0zRHGVoUugWvXg=,44fae6e8771331f54f267d9440a9d520e7daeb91817ff61e26b8494099ae046a
+github.com/multiformats/go-multistream,v0.1.0,h1:UpO6jrsjqs46mqAK3n6wKRYFhugss9ArzbyUzU+4wkQ=,f720be6e29845f0a41c1241a24f19c08adf762f9e7e972b4096416776c603b15
+github.com/munnerz/goautoneg,v0.0.0-20191010083416-a7dc8b61c822,h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=,3d7ce17916779890be02ea6b3dd6345c3c30c1df502ad9d8b5b9b310e636afd9
+github.com/mwitkow/go-conntrack,v0.0.0-20190716064945-2f068394615f,h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=,d6fc513490d5c73e3f64ede3cf18ba973a4f8ef4c39c9816cc6080e39c8c480a
+github.com/mwitkow/go-grpc-middleware,v1.0.0,h1:XraEe8LhUuB33YeV4NWfLh2KUZicskSZ2lMhVRnDvTQ=,074f46f92d7a0043c5b283f1af224123cc48e21f96b259e62f77b6da72240812
+github.com/mxk/go-flowrate,v0.0.0-20140419014527-cca7078d478f,h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=,bd0701ef9115469a661c07a3e9c2e572114126eb2d098b01eda34ebf62548492
+github.com/myesui/uuid,v1.0.0,h1:xCBmH4l5KuvLYc5L7AS7SZg9/jKdIFubM7OVoLqaQUI=,3055c4b167daeb9984ccd7c8eeba154e3d84afa6fdf06a3151280ef120d1633d
+github.com/myitcv/gobin,v0.0.8,h1:hQORun03Mlnm8yp/OgKX8UYSIVZQ8ebTWf3aahY1u+s=,015311e9db646cb9e5f63a0586c466c9eb5bc5f45661282644f8a5b549607e72
+github.com/myitcv/vbash,v0.0.2,h1:8R+91eSlfcgoRjEbnUgvbXYOmfh+p0+7i5klFOM5VMA=,08dcf62b94843e7fd115cd0605158d948fb361ca8c958db1958c5d2feef9c2d1
+github.com/namedotcom/go,v0.0.0-20180403034216-08470befbe04,h1:o6uBwrhM5C8Ll3MAAxrQxRHEu7FkapwTuI2WmL1rw4g=,0c6ea2c994e982c25e44ccba2ead1a9655cd2f253986eedb73253c30ad21b42f
+github.com/naoina/go-stringutil,v0.1.0,h1:rCUeRUHjBjGTSHl0VC00jUPLz8/F9dDzYI70Hzifhks=,4cfea6f0ebfecb5e6297f8a6eee0e9ef9fe254883eb75dd6179133995a219c58
+github.com/naoina/toml,v0.1.1,h1:PT/lllxVVN0gzzSqSlHEmP8MJB4MY2U7STGxiouV4X8=,8e34d510563d9e8b3f2dbdf0927bf5108b669144bdbe2fda4fcb44e7e2e55268
+github.com/natefinch/lumberjack,v2.0.0+incompatible,h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM=,1f6e7c9e0b915c45151d8780a8711426b19d16d04c9cf0e7995b29035d6b500f
+github.com/nats-io/gnatsd,v1.3.0,h1:+5d80klu3QaJgNbdavVBjWJP7cHd11U2CLnRTFM9ICI=,85fa90b3eaef17698734d398a9939b8bb94df1b9f35bc92c8d31cb7a349c1e97
+github.com/nats-io/go-nats,v1.6.0,h1:FznPwMfrVwGnSCh7JTXyJDRW0TIkD4Tr+M1LPJt9T70=,8c63be6f10479802a40c66c0999f724e492bcb9863d5517038c6472e585a76aa
+github.com/nats-io/go-nats-streaming,v0.4.2,h1:e7Fs4yxvFTs8N5xKFoJyw0sVW2heJwYvrUWfdf9VQlE=,62dd1d6ba18f3b7686766116e3beaaf9f62b89b58a6efb0b8f1ad04d3ddfb026
+github.com/nats-io/jwt,v0.3.0,h1:xdnzwFETV++jNc4W1mw//qFyJGb2ABOombmZJQS4+Qo=,e131314c7cf6a714ec10ca3b6f95f8af6a41f5cdaf72a364f7c71b33e97314db
+github.com/nats-io/nats,v1.6.0,h1:U5b2apHOTZlUou+NGfCRWG4ZEeivbt2hpsZO4kHKIVU=,12cc70ed3477472d110d4b4bc109fbe20218e8199629669ad5f617c199fbf9d2
+github.com/nats-io/nats-server/v2,v2.1.0,h1:Yi0+ZhRPtPAGeIxFn5erIeJIV9wXA+JznfSxK621Fbk=,a5897b8f5302ae38894de2c240f31d33ab7b2f3d4e88a2c212fc9b31f2d4f444
+github.com/nats-io/nats-streaming-server,v0.12.2,h1:EpyLfUBZgwu5c0mdSSytQsapm615AyitPssq7jgafdw=,48605f61f74903ba1322f11aa17806b57f71cebf2557b7dd8620d4193abc868d
+github.com/nats-io/nats.go,v1.9.1,h1:ik3HbLhZ0YABLto7iX80pZLPw/6dx3T+++MZJwLnMrQ=,34a735d158d70685faad1fc3153f08da0ddc21c0ae42f6a0cb09430d638364b2
+github.com/nats-io/nkeys,v0.1.0,h1:qMd4+pRHgdr1nAClu+2h/2a5F2TmKcCzjCDazVgRoX4=,dbc82abacf752e532ffd67db230a97f52a5f92070b04b4028cb79534d2ab0ef6
+github.com/nats-io/nuid,v1.0.1,h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=,809d144fbd16f91651a433e28d2008d339e19dafc450c5995e2ed92f1c17c1f3
+github.com/nats-io/stan.go,v0.5.0,h1:ZaSPMb6jnDXsSlOACynJrUiB3Evleg3ZyyX+rnf3TlQ=,1dcb14e2ef8ad30dd1ee61a63b0a3bfbaa48e9c3d13f69458a149956a14bbab7
+github.com/nbio/st,v0.0.0-20140626010706-e9e8d9816f32,h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4=,e6cd27bd360be27d0f7efd3c4c41c4e14e659e60086b0bc4f09fb09cfd02a50d
+github.com/ncw/swift,v1.0.49,h1:eQaKIjSt/PXLKfYgzg01nevmO+CMXfXGRhB1gOhDs7E=,b2be24cad8923c9171835547df2d621d2aa2029ceb9fa770d6ecf3bf70c2c029
+github.com/neelance/astrewrite,v0.0.0-20160511093645-99348263ae86,h1:D6paGObi5Wud7xg83MaEFyjxQB1W5bz5d0IFppr+ymk=,815811c2140669e55e99d59d4bdd2fcf4c810610a9d278fd25cc2c3480c002d4
+github.com/neelance/sourcemap,v0.0.0-20151028013722-8c68805598ab,h1:eFXv9Nu1lGbrNbj619aWwZfVF5HBrm9Plte8aNptuTI=,ce5499f29779a604233bb76f36925c3326a8a8f270533df8d3dff1107b7aa066
+github.com/neurosnap/sentences,v1.0.6,h1:iBVUivNtlwGkYsJblWV8GGVFmXzZzak907Ci8aA0VTE=,9dbe86e291937eba92847454650d1c65338527ff89dec5daccb99aaf7e03865b
+github.com/newrelic/go-agent,v2.15.0+incompatible,h1:IB0Fy+dClpBq9aEoIrLyQXzU34JyI1xVTanPLB/+jvU=,4c541c5f7b10055c37cf22843edbb9b0fcb06ad3504e8d6eae3d9c37ff3c64c6
+github.com/nf/cr2,v0.0.0-20140528043846-05d46fef4f2f,h1:nyKdx+jcykIdxGNrbgo/TGjdGi99EY9FKBCjYAUS4bU=,665afbe7830424dd9815cae42aa7762b657484686d671f88704257ea7c9736be
+github.com/nfnt/resize,v0.0.0-20180221191011-83c6a9932646,h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=,b8e97cb14e5e5ef29d762d2dff890f6279a125990ddf9cb7ae5c4d2a015b109c
+github.com/ngaut/pools,v0.0.0-20180318154953-b7bc8c42aac7,h1:7KAv7KMGTTqSmYZtNdcNTgsos+vFzULLwyElndwn+5c=,26342833d7a5b91a52f8451e8e34bc9ffc5069d342666ab0b478628c41a86d44
+github.com/ngaut/sync2,v0.0.0-20141008032647-7a24ed77b2ef,h1:K0Fn+DoFqNqktdZtdV3bPQ/0cuYh2H4rkg0tytX/07k=,2635d6120b6172c190f84b57b5fc878f9158b768b4bd6bd4468bfa98a73061a4
+github.com/nicksnyder/go-i18n,v2.0.2+incompatible,h1:Xt6dluut3s2zBUha8/3sj6atWMQbFioi9OMqUGH9khg=,687be9dc953545d390761e5464e07c38f313d19c1f695f7d7702d954afcf6b66
+github.com/nicolai86/scaleway-sdk,v1.10.2-0.20180628010248-798f60e20bb2,h1:BQ1HW7hr4IVovMwWg0E0PYcyW8CzqDcVmaew9cujU4s=,a2e992324edd4396f24e0b6a165c4d1057eeefdecdc9f7472b0de8a30f3be729
+github.com/niklasfasching/go-org,v0.1.6,h1:F521WcqRNl8OJumlgAnekZgERaTA2HpfOYYfVEKOeI8=,c938afb1ad7f567524686395c9de66da75220eaa60fe8917c02b97aa1e2cbbb1
+github.com/nkovacs/streamquote,v0.0.0-20170412213628-49af9bddb229,h1:E2B8qYyeSgv5MXpmzZXRNp8IAQ4vjxIjhpAf5hv/tAg=,679a789b4b1409ea81054cb12e5f8441199f5fb17d4a2d3510c51f3aa5f3f0cc
+github.com/nlopes/slack,v0.6.0,h1:jt0jxVQGhssx1Ib7naAOZEZcGdtIhTzkP0nopK0AsRA=,048ddfddd4a66407f26b069a65d4d8f3d6d0368adcd52fd5a0dc6d86fe012f47
+github.com/nrdcg/auroradns,v1.0.0,h1:b+NpSqNG6HzMqX2ohGQe4Q/G0WQq8pduWCiZ19vdLY8=,81e3564b38ca27024b6e981a03ae70afcf435d5f8d35a2113321dfd3a220f00b
+github.com/nrdcg/goinwx,v0.6.1,h1:AJnjoWPELyCtofhGcmzzcEMFd9YdF2JB/LgutWsWt/s=,8e1e3ea7d38f5b9b21603350d97a583c9108d380f5cc08bf93a4c69d6968dc8a
+github.com/nrdcg/namesilo,v0.2.1,h1:kLjCjsufdW/IlC+iSfAqj0iQGgKjlbUUeDJio5Y6eMg=,e20a47d9257fcf7ce95254b14bb84ba290b5f4867e4d63027b669f5a55aaab6c
+github.com/nsf/jsondiff,v0.0.0-20160203110537-7de28ed2b6e3,h1:OqFSgO6CJ8heZRAbXLpT+ojX+jnnGij4qZwUz/SJJ9I=,9652618358184592fb7a4657e2c51748cbe0bf5bbf97150a2c6e95ecf65b126b
+github.com/nsf/termbox-go,v0.0.0-20190817171036-93860e161317,h1:hhGN4SFXgXo61Q4Sjj/X9sBjyeSa2kdpaOzCO+8EVQw=,a64e374836a25ab74ece4eb5314d79617d8b828bd6d13c654d95bed920c82784
+github.com/nsqio/go-nsq,v1.0.7,h1:O0pIZJYTf+x7cZBA0UMY8WxFG79lYTURmWzAAh48ljY=,5acb7902bf31355fa7d77f507ed42847368834eb378fbf407d82ae3e4211e248
+github.com/nu7hatch/gouuid,v0.0.0-20131221200532-179d4d0c4d8d,h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ=,0889a0ac13cfa9f32f986a88a82bb24380070932299131ae7d7180a389d08ca7
+github.com/nullstyle/go-xdr,v0.0.0-20180726165426-f4c839f75077,h1:A804awGqaW7i61y8KnbtHmh3scqbNuTJqcycq3u5ZAU=,0ab4f958f0420027d40b53c98bcb8f3cbe1e106dfb49d3e91415cb1c512a552c
+github.com/nutmegdevelopment/sumologic,v0.0.0-20160817160817-42ed9b372fa3,h1:xOEJG5C3e8CvgAYsnkgoSBzCr0No+m++aB6v7A2WScY=,a33916e02e1159304145b621ffdf284120e50f618c684f38776a8bab7ae7b3fe
+github.com/nwaples/rardecode,v0.0.0-20171029023500-e06696f847ae,h1:UF9xsJn7AeQ72TCus3eRO1lh08Id3AoF37vl+qigL/w=,5598a02308af3b04418b15854ff940be49cf31ce7238ce23c10409110364d40f
+github.com/ogier/pflag,v0.0.1,h1:RW6JSWSu/RkSatfcLtogGfFgpim5p7ARQ10ECk5O750=,c4db0ecff32deb3205c705d72a616bce01e1f6a1948c851d30b52deeec3fbf91
+github.com/oklog/run,v1.0.0,h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=,108d409b7d235d61b82cfb6e1df139501123fcd8fa68fe94ddb024b53335cb48
+github.com/oklog/ulid,v1.3.1,h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=,40e502c064a922d5eb7f2bc2cda9c6a2a929ec0fc76c9aae4db54fb7b6b611ae
+github.com/olekukonko/tablewriter,v0.0.1,h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88=,7e5cc8a9b5a51126a0cb46ac96b274d92a8b1cc24b2321832c38d60c0ea4cc9c
+github.com/oliamb/cutter,v0.2.2,h1:Lfwkya0HHNU1YLnGv2hTkzHfasrSMkgv4Dn+5rmlk3k=,9174c2374109a7d3aeb2c59b5f4b744ec5f65752aab797f0d50beb26cfc7d857
+github.com/olivere/elastic,v6.2.25+incompatible,h1:X34sPAlSpZVlnuSjOYwbMbiCMU+WKK7YUxrunuNSdG8=,bf3b4cc7ea89a716e91002a31b33f55ec3168ce5ab36ffe5c02ff68d94b9aad5
+github.com/olivere/env,v1.1.0,h1:owp/uwMwhru5668JjMDp8UTG3JGT27GTCk4ufYQfaTw=,f486deab73b3d7866e762e1ad34fe63c88e9ac38f41d811414361fb6490bbb2c
+github.com/onsi/ginkgo,v1.10.3,h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY=,088314495acb90d1e520519b243f4dbdd17b43469e6fb83bd45d600796856e63
+github.com/onsi/gomega,v1.7.1,h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ=,0a245e719f17cc2bc399aa7c2005cca84f1cfba5373b0c96f5c64673f758a712
+github.com/op/go-logging,v0.0.0-20160315200505-970db520ece7,h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88=,c506eace74028656eb28677a4c162f9c023ce2f9c0207354ba80cca89f11b461
+github.com/openconfig/gnmi,v0.0.0-20190823184014-89b2bf29312c,h1:a380JP+B7xlMbEQOlha1buKhzBPXFqgFXplyWCEIGEY=,f52967c7b194daa57252042f6ccf9d26f8c599a7e13aca26043f948d5139b91a
+github.com/openconfig/reference,v0.0.0-20190727015836-8dfd928c9696,h1:yHCGAHg2zMaW8olLrqEt3SAHGcEx2aJPEQWMRCyravY=,040cf32cee7256a08716313dd7ea4f8c44f1d644ae872ecf2dd381c35b12125c
+github.com/opencontainers/go-digest,v1.0.0-rc1,h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ=,25fd455029e8a1bbe15ed2eeafc67222372c6f305a47b4ec157d8a1a2849c15c
+github.com/opencontainers/image-spec,v1.0.1,h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=,ebb2dca711a137fbfb717158b0368792f834000f4308d9ea259d06c6804c677c
+github.com/opencontainers/runc,v0.1.1,h1:GlxAyO6x8rfZYN9Tt0Kti5a/cP41iuiO2yYT0IJGY8Y=,aa212163f009190d0f4f3dbe64f71fcda06d7896b67863d7f7b185fee6a68ea6
+github.com/opencontainers/runtime-spec,v1.0.1,h1:wY4pOY8fBdSIvs9+IDHC55thBuEulhzfSgKeC1yFvzQ=,1958458b00ce912425f5c7d2ee836431b296a3f9320d565512d8c96b107fffbf
+github.com/opencontainers/runtime-tools,v0.9.0,h1:FYgwVsKRI/H9hU32MJ/4MLOzXWodKK5zsQavY8NPMkU=,53c720dbb7452cfb2fd3945e37c26b5a0140cb1012d35a2b72a5e035f28a32c4
+github.com/opencontainers/selinux,v1.3.0,h1:xsI95WzPZu5exzA6JzkLSfdr/DilzOhCJOqGe5TgR0g=,88286825b32cd46a0469e578f378a185032da2d5b03893623861ef3af59359d8
+github.com/openshift/api,v3.9.0+incompatible,h1:fJ/KsefYuZAjmrr3+5U9yZIZbTOpVkDDLDLFresAeYs=,fc087ac9809ce58bdd15614e04c13f8ecc4a17e71addbe6eb6b777c377b01243
+github.com/openshift/client-go,v3.9.0+incompatible,h1:13k3Ok0B7TA2hA3bQW2aFqn6y04JaJWdk7ITTyg+Ek0=,661b7f28b4905f1936dd58e373374513d54663ec85aecafede1c7d9c260e9369
+github.com/openshift/library-go,v0.0.0-20191101161407-e7c97b468b83,h1:wwR+laNaFKVGiizoIDL/cAKIZVoKXJ9jbjUoUlq2p5I=,c74f8134013f978ef154d6accf9b4b0c5126941f2d45e6eb223db7098f7ab2a4
+github.com/opentracing-contrib/go-observer,v0.0.0-20170622124052-a52f23424492,h1:lM6RxxfUMrYL/f8bWEUqdXrANWtrL7Nndbm9iFN0DlU=,50023eee1ef04412410f43d8b5dcf3ef481c0fc39067add27799654705fa84b2
+github.com/opentracing-contrib/go-stdlib,v0.0.0-20190519235532-cf7a6c988dc9,h1:QsgXACQhd9QJhEmRumbsMQQvBtmdS0mafoVEBplWXEg=,966cdf6d869ff62c35edf1ea00113465cc9b90f34838c6a6990a1f776e7d1152
+github.com/opentracing/basictracer-go,v1.0.0,h1:YyUAhaEfjoWXclZVJ9sGoNct7j4TVk7lZWlQw5UXuoo=,a908957c8e55b7b036b4761fb64c643806fcb9b59d4e7c6fcd03fca1105a9156
+github.com/opentracing/opentracing-go,v1.1.0,h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=,3e0f42d035019fa037991d340da9677a802f8182792770c38e87906d33e06629
+github.com/openzipkin-contrib/zipkin-go-opentracing,v0.4.4,h1:bzTJRoOZEN7uI1gq594S5HhMYNSud4FKUEwd4aFbsEI=,8a4688f80cd67140aa4edb91506d440ecea4d8ec01634caab5c95991af011c5d
+github.com/openzipkin/zipkin-go,v0.2.2,h1:nY8Hti+WKaP0cRsSeQ026wU03QsM762XBeCXBb9NAWI=,dfc610dc52d9299df49172a9e61fcc772d85450b6b6f82e8f43cf23562232a4c
+github.com/oracle/oci-go-sdk,v7.0.0+incompatible,h1:oj5ESjXwwkFRdhZSnPlShvLWYdt/IZ65RQxveYM3maA=,941cd26813b22873477f1c6bb86fed929bdc85379d435bd9707d923f57d070dc
+github.com/orcaman/concurrent-map,v0.0.0-20190826125027-8c72a8bb44f6,h1:lNCW6THrCKBiJBpz8kbVGjC7MgdCGKwuvBgc7LoD6sw=,ec80830c751199283290a8d398ebf28ca5169e866a70347b39856d2c1178f2cb
+github.com/ory/dockertest,v3.3.4+incompatible,h1:VrpM6Gqg7CrPm3bL4Wm1skO+zFWLbh7/Xb5kGEbJRh8=,cbcc7ba21c846d38229aa06a2d7cf35b99ac219eb2694bd9a1ceeac89667e475
+github.com/ory/herodot,v0.6.2,h1:zOb5MsuMn7AH9/Ewc/EK83yqcNViK1m1l3C2UuP3RcA=,caf465ffb73c7537212ba4fd58a4c2c41fe7ca69737404a28e84ceff90c340ea
+github.com/otiai10/copy,v0.0.0-20180813032824-7e9a647135a1,h1:A7kMXwDPBTfIVRv2l6XV3U6Su3SzLUzZjxnDDQVZDIY=,67d0e4f6ba369653e30257882fbbb20c28b560bc837e1847a42c48e868f1c81c
+github.com/otiai10/curr,v0.0.0-20150429015615-9b4961190c95,h1:+OLn68pqasWca0z5ryit9KGfp3sUsW4Lqg32iRMJyzs=,7cf2143067d9bb3e7d54d2906766bb24c11d76f1bb0b0c5069574e9a0d8ae93d
+github.com/otiai10/mint,v1.2.3,h1:PsrRBmrxR68kyNu6YlqYHbNlItc5vOkuS6LBEsNttVA=,0b82a05ca43810c9aa8299ddae1663feeb178d699aeb5242c3bdeb61cb5a54fb
+github.com/outscale/osc-go,v0.0.1,h1:hvBtORyu7sWSKW1norGlfIP8C7c2aegI2Vkq75SRPCE=,2a988384c564fdba8b8c496024aafc212140e4b996654be7a92a3b0c7a962632
+github.com/ovh/go-ovh,v0.0.0-20181109152953-ba5adb4cf014,h1:37VE5TYj2m/FLA9SNr4z0+A0JefvTmR60Zwf8XSEV7c=,0fa35e8026a9b3aebd804739f31ffe07e553b84e2b8ea145b2f2ebaa0dd7c08f
+github.com/oxtoacart/bpool,v0.0.0-20190530202638-03653db5a59c,h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw=,6816ec3a6f197cbee0ba6ddb9ec70958bc28870e59864b24e43da0c858079a1b
+github.com/packer-community/winrmcp,v0.0.0-20180921204643-0fd363d6159a,h1:A3QMuteviunoaY/8ex+RKFqwhcZJ/Cf3fCW3IwL2wx4=,4a48fa503853d129e7e32ca81f069b9e09a9e3249739781f61fae70bb02d098b
+github.com/packethost/packngo,v0.1.1-0.20180711074735-b9cb5096f54c,h1:vwpFWvAO8DeIZfFeqASzZfsxuWPno9ncAebBEP0N3uE=,6dac4e55c104df58ace636ef31d5dd6173a36747c4fd79299252ba8826127491
+github.com/parnurzeal/gorequest,v0.2.16,h1:T/5x+/4BT+nj+3eSknXmCTnEVGSzFzPGdpqmUVVZXHQ=,cc7b7d56e2e4c3fa0709e0e547875807746ac067b2a5c4b740b3088c1fdf941d
+github.com/pascaldekloe/goe,v0.1.0,h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=,37b73886f1eec9b093143e7b03f547b90ab55d8d5c9aa3966e90f9df2d07353c
+github.com/patrickmn/go-cache,v2.1.0+incompatible,h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=,d5d1c13e3c9cfeb04a943f656333ec68627dd6ce136af67e2aa5881ad7353c55
+github.com/pborman/uuid,v1.2.0,h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=,b888ff5d33651a1f5f6b8094acc434dd6dc284e2fe5052754a7993cebd539437
+github.com/pelletier/go-buffruneio,v0.2.0,h1:U4t4R6YkofJ5xHm3dJzuRpPZ0mr5MMCoAWooScCR7aA=,70593688607f4d48192776fe257ab9298689267ebcdd7b155bfe40d893735f38
+github.com/pelletier/go-toml,v1.6.0,h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4=,cc6dce19df6c6c30abd67594d17ea6015d1210aa6dd8c6096c6429eec06fdab4
+github.com/peterbourgon/diskv,v2.0.1+incompatible,h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=,1eeff260bd1ad71cd1611078995db99e1c7eba28628e7d6f24c79039536ea1cb
+github.com/peterbourgon/g2s,v0.0.0-20170223122336-d4e7ad98afea,h1:sKwxy1H95npauwu8vtF95vG/syrL0p8fSZo/XlDg5gk=,41526f42b4fe3019581ab3745afea18271d7f037eb55a6e9fb3e32fd09ff9b8d
+github.com/petergtz/pegomock,v2.7.0+incompatible,h1:42rJ5wIOBAg9OGdkLaPW9PlF/RtqDc5aGl6PcTCXl3o=,dc93e4483e8de4eb429e007aad17348822197ea7a3adde283b7752bc4544dfbb
+github.com/peterh/liner,v1.1.0,h1:f+aAedNJA6uk7+6rXsYBnhdo4Xux7ESLe+kcuVUF5os=,5cdc45c19901db8d8295c139bb382d7eea150e8fd96bd26de10384685728a461
+github.com/peterhellberg/link,v1.0.0,h1:mUWkiegowUXEcmlb+ybF75Q/8D2Y0BjZtR8cxoKhaQo=,d320f4204fbe886e1cefc0b677af2bfaba855e9e6556a6e92e43bcd80c3bb7a5
+github.com/petermattis/goid,v0.0.0-20180202154549-b0b1615b78e5,h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ=,5134a176e306f9b973ff670a33c7536b59bf4114d83fd94f74c736ff0cc10ef0
+github.com/phayes/freeport,v0.0.0-20180830031419-95f893ade6f2,h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc=,4ac97358de55a9b1ac60f13fdb223c5309a129fb3fb7bf731062f9c095a0796c
+github.com/philhofer/fwd,v1.0.0,h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=,b4e79b1f5fdfe8c44bf6dae3dd593c62862930114411a30968f304084de1d0b3
+github.com/pierrec/lz4,v2.3.0+incompatible,h1:CZzRn4Ut9GbUkHlQ7jqBXeZQV41ZSKWFc302ZU6lUTk=,775487f2be5ddf23034b59bc862cb0d5767155c5e08d1186665d117092ceb50f
+github.com/pingcap/check,v0.0.0-20190102082844-67f458068fc8,h1:USx2/E1bX46VG32FIw034Au6seQ2fY9NEILmNh/UlQg=,b8eeddacc35915d8c40b42e9af4db468ed309a506412a767ba6bb03bb7ce4627
+github.com/pingcap/errors,v0.11.4,h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=,df62e548162429501a88d936a3e8330f2379ddfcd4d23c22b78bc1b157e05b97
+github.com/pingcap/gofail,v0.0.0-20181217135706-6a951c1e42c3,h1:04yuCf5NMvLU8rB2m4Qs3rynH7EYpMno3lHkewIOdMo=,444866a53b7429e80a8a16791e39555de8103c7514cd322fe191c902b8071360
+github.com/pingcap/goleveldb,v0.0.0-20171020122428-b9ff6c35079e,h1:P73/4dPCL96rGrobssy1nVy2VaVpNCuLpCbr+FEaTA8=,08ec0ffe5d0d74bdc543695f975316af6a63c17e36644ae56d42e30b0d1f8777
+github.com/pingcap/kvproto,v0.0.0-20191101062931-76b56d6eb466,h1:C5nV9osqA+R/R2fxYxVfqAUlCi3Oo5yJ/JSKDeHSAOk=,0d834c10c217c5de2c9ef79049891a69e73e102c4dbcd130173c3650e96da570
+github.com/pingcap/log,v0.0.0-20191012051959-b742a5d432e9,h1:AJD9pZYm72vMgPcQDww9rkZ1DnWfl0pXV3BOWlkYIjA=,eaece6f27792a39ccff08152050d4eb7905c250bf36877cacdd7e74c79d80472
+github.com/pingcap/parser,v0.0.0-20191101070347-94a5ef60f10b,h1:TLljHrSTC9MCTiUA6nMhV68my/D/FI3VNkUs94Wo3DE=,94e6857f4d2bf653edf4c2881cb8fb6b3abdf9efaec7d1f49159deec77580df2
+github.com/pingcap/pd,v2.1.17+incompatible,h1:mpfJYffRC14jeAfiq0jbHkqXVc8ZGNV0Lr2xG1sJslw=,b75266cd20abe6b1ccbb777a2f71d74dfcf231a06276b602df08bf27a9ea36f1
+github.com/pingcap/tidb-tools,v2.1.4+incompatible,h1:dkB4FMJcSk9GYRB2ICupU/lsTLf4mHLfkBE6fAsLdJ4=,c5c8e2b5c69c21bba2050c75d3a4582eda26308a355557036f058365d4583e5f
+github.com/pingcap/tipb,v0.0.0-20191030045153-07a0962bbc64,h1:wUSHIp4dura5/YAepdgDBEdf2zz20MHXyNtMi1TcaDE=,8ac8e775e3d5fd255b7a8f07460f3b19bebb04cb50a3c0f5d6f64cc2fd585177
+github.com/pkg/browser,v0.0.0-20180916011732-0a3d74bf9ce4,h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98=,b845f84fbf08bba75401a4eff94c01c9e2c668fa1b43016e835bd60c6a8b4e87
+github.com/pkg/errors,v0.8.1,h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=,4e47d021340b7396a7dee454f527552faf7360a9fc34038b1dc32ba3b5a951d8
+github.com/pkg/profile,v1.3.0,h1:OQIvuDgm00gWVWGTf4m4mCt6W1/0YqU7Ntg0mySWgaI=,5f20c007ac81019900f06cf1e4d451ce8e1d981460e39e04794fbcc60639f851
+github.com/pkg/sftp,v1.10.1,h1:VasscCm72135zRysgrJDKsntdmPN+OuU3+nnHYA9wyc=,4e30f0455865434be7b83d4010ab97667217dafd0017caa651faafa2cc6aed64
+github.com/pkg/term,v0.0.0-20180730021639-bffc007b7fd5,h1:tFwafIEMf0B7NlcxV/zJ6leBIa81D3hgGSgsE5hCkOQ=,165bb00eeab26fe65c64e0e13bc29abc7ea18ac28d288e2218c137cd0bd91d9b
+github.com/plaid/plaid-go,v0.0.0-20161222051224-02b6af68061b,h1:Don6I/E8nLCT6gdBi1sKB9hYxkx/24YD7XWwSly8IEo=,bd900ff0acd2968150f60770ab4e870d9f6b92c129a49eac0c9620a8043f901e
+github.com/pmezard/go-difflib,v1.0.0,h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=,de04cecc1a4b8d53e4357051026794bcbc54f2e6a260cfac508ce69d5d6457a0
+github.com/polydawn/refmt,v0.0.0-20190408063855-01bf1e26dd14,h1:2m16U/rLwVaRdz7ANkHtHTodP3zTP3N451MADg64x5k=,a92440a944006fd3e0b6f1717fce4c2ea490cf2c4af93b56675216204f138c3a
+github.com/portworx/kvdb,v0.0.0-20190911174000-a0108bddd091,h1:DqGiNhvCpvhWW/HJ1naJa0DudtlckvzQ9hEXSsOyv8Y=,d6fa957e1469a1b47ccbebc805034bafc5ed24798a1bef8675f751f9c4ed961e
+github.com/portworx/sched-ops,v0.0.0-20191101005636-ded833c86f1e,h1:emQnaLwLEYN3Hner2ekVuZfrcChdN3H3J4Lxu5mPe64=,43ff366e97ff640a34a566c81dd7d63537c2864da85d33b49d5261417cd8d4b0
+github.com/posener/complete,v1.2.1,h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6DI=,a97f73829e0b71ae7a8f17a4884d5dcbb2c3499d8d3a077c2a8d7c2596f68d37
+github.com/pquerna/cachecontrol,v0.0.0-20180517163645-1555304b9b35,h1:J9b7z+QKAmPf4YLrFg6oQUotqHQeUNWwkvo7jZp1GLU=,0e5185ab4dab1bb2241e9e23e36ebde5713f3fb1e47767c3eb44001b7e17644f
+github.com/pquerna/ffjson,v0.0.0-20190930134022-aa0246cd15f7,h1:xoIK0ctDddBMnc74udxJYBqlo9Ylnsp1waqjLsnef20=,377b4667540f620eae19722b5346f6f1efdea5688f9eedda97f2c659dad131f9
+github.com/pquerna/otp,v1.1.0,h1:q2gMsMuMl3JzneUaAX1MRGxLvOG6bzXV51hivBaStf0=,d46d289853f801387dfc514fd50133de30b684a6af34031b27caa877cbb7f687
+github.com/profitbricks/profitbricks-sdk-go,v4.0.2+incompatible,h1:ZoVHH6voxW9Onzo6z2yLtocVoN6mBocyDoqoyAMHokE=,b0baf185752eb96f8890f3e9adf856b13f5c43b5346387b659e2b1deb1d087c7
+github.com/project-flogo/core,v0.9.3,h1:uZXHR9j1Byqt+x3faNnOqB8NlEfwE2gpCh40iQ+44oA=,d1c43e3bc517bb438a9d313d976e327ba219232418064d439fb20671341832a2
+github.com/projectcalico/libcalico-go,v1.7.3,h1:qcbxAhsq/5zqZqpHE24VqMHfmoBVdXZV0Kf82+5rbqU=,4f638d56eb47ff8e1763f65131050294f7d2c828139276fe86127a803245ae8c
+github.com/prometheus/alertmanager,v0.18.0,h1:sPppYFge7kdf9O96KIh3fd093D1xN8JxIp03wW6yAEE=,45e122e7c2ac69577d63844313798060673a28b2e86ec8a0197f330c584b379b
+github.com/prometheus/client_golang,v1.2.1,h1:JnMpQc6ppsNgw9QPAGF6Dod479itz7lvlsMzzNayLOI=,174c921fe3e154adddd8e0dc572323dd04901bcad0965de614174241981da57c
+github.com/prometheus/client_model,v0.0.0-20190812154241-14fe0d1b01d4,h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=,5d4719be47f4f69ab5bf36a04c75eb078a0f69b43a335f400c2d688ac9e61795
+github.com/prometheus/common,v0.7.0,h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY=,f2640a94b18b115552df41ee33effa013e10536aca51e09a971d1503a20e186a
+github.com/prometheus/procfs,v0.0.5,h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8=,f45b90c72f8c2e4c84e5314092ee1ccf7d6ace1cc14b2f483c82f7c1e6d0d0d4
+github.com/prometheus/prom2json,v1.1.0,h1:/fEL2DK7EEyHVeGMG4TV+gSS9Sw53yYKt//QRL0IIYE=,166f5f98c62d0b90139947d1464ee747f8143772b9e926c7b51c53a4420380ff
+github.com/prometheus/prometheus,v2.5.0+incompatible,h1:7QPitgO2kOFG8ecuRn9O/4L9+10He72rVRJvMXrE9Hg=,ede73f6ccabd60365549986a6c7ae152c1952129006c8ae521c86ff45c4aadcc
+github.com/prometheus/tsdb,v0.10.0,h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic=,34e98f0e9ba55e7290774ee40569737745b395e32811e5940d2ed124a20f927c
+github.com/pyinx/gorocket,v0.0.0-20170810024322-78ae1353729f,h1:N1r6pSlez3lLsqaNHbtrHW9ZuzrilETIabr9jPNj3Zs=,dcd920b789a98157bbe1ed7fff249255c1dd4d2fd80f7edc39b3a49fc08db13a
+github.com/qor/admin,v0.0.0-20191021122103-f3db8244d2d2,h1:IWw22+hlihdss/qI93QH48jTBUEOD/fsBqj+0z61z/Y=,722e243550878791adcdb3bcea66ab8e7a185637c8a7ad0a752713951aef2a91
+github.com/qor/assetfs,v0.0.0-20170713023933-ff57fdc13a14,h1:JRpyNNSRAkwNHd4WgyPcalTAhxOCh3eFNMoQkxWhjSw=,7fe36875e7e59afd9154f827babbffaa7f67ac54b7790df5a4a4a376c78b2282
+github.com/qor/middlewares,v0.0.0-20170822143614-781378b69454,h1:+WCc1IigwWpWBxMFsmLUsIF230TakGHstDajd8aKDAc=,4c2ed9a2f7b24dfa64464091b2c01ce9fc947524bb834d77aeb9ceaf8610e5fc
+github.com/qor/qor,v0.0.0-20191022064424-b3deff729f68,h1:MSbP9P4HnmEyH+uGQAW+V0HoTzlZ9SRq7kdCaRiZEmU=,9053796b8a7afe21483262affaf5b35bac8bf3387e24531448a4833d7b758978
+github.com/qor/render,v1.1.1,h1:DaGaKlf0OzpOB+hJUEiOTbZ40mg+n+LlSJx20/KUfes=,8f957a13173ef1a22d0caeea1cc6d198b064d242676444e00e2f597c405928c9
+github.com/qor/responder,v0.0.0-20171031032654-b6def473574f,h1:sKELSAyL+z5BRHFe97Bx71z197cBEobVJ6rASKTMSqU=,b69784649ec65ec2580d7640af25ec66973d59d82ec5391498cfe4c3076e5f6f
+github.com/qor/roles,v0.0.0-20171127035124-d6375609fe3e,h1:F0BNcPJKfubM/+IIILu/GbrH9v2vPZWQ5/StSRKUfK4=,1a35a5480c7169e86025eb19dbcddc13fd00472e6b4ade7574e62c290cf09100
+github.com/qor/session,v0.0.0-20170907035918-8206b0adab70,h1:8l21EEdlZ9R0AA3FbeUAANc5NAx8Y3tn1VKbyAgjYlI=,7c759bc736c4936a602ca1f0ebad9a324d8332ffd342e1e3acd80355180fc858
+github.com/qor/validations,v0.0.0-20171228122639-f364bca61b46,h1:dRlsVUhwD1pwrasuVbNooGQITYjKzmXK5eYoEEvBGQI=,b29360c4a4e9cc8d0ff682d8bf1f446a5d61d5a4f8d3cf2fc6d8cc077e5d810f
+github.com/racker/perigee,v0.1.0,h1:8RjBm1YGJKVVjUfO02Uok+npegz8lSSEVqjimDqlFYc=,d43613102ed67445c9fc81b621959b58f827c187189b09cec236c3bac5ce1ccb
+github.com/raff/goble,v0.0.0-20190909174656-72afc67d6a99,h1:JtoVdxWJ3tgyqtnPq3r4hJ9aULcIDDnPXBWxZsdmqWU=,ef5dde1af55d451c37ddf13e17ae339d299903cb7e67567fc6d1e69688a789e1
+github.com/rai-project/config,v0.0.0-20190926180509-3bd01e698aad,h1:o0056EwcQBeyaVb2my+T0TvMR5FpEY0CGNgWkbj/xEo=,27c2311ad1fdc185e08f2e1703893482b7d26caf64854ed371bf38f3a9303f92
+github.com/rai-project/godotenv,v0.0.0-20180619160704-a501614c3b8d,h1:reVy+ViZcrx1ILo+L8wa3dGf6hSd4qlY62VqxZxEgWs=,f4d9ecb56f20667fbb09bd5256d0c6b81b9e8cbca8f6476240c5d1800ffb07ed
+github.com/rai-project/logger,v0.0.0-20190701163301-49978a80bf96,h1:GeXSVSRfXOBN5XHNA+wq5G+sfq99mhpwn6U5kcGwSeg=,53d7677e7d7dab6b1f83591ec10491301289752e337641403f8413c0749b84d8
+github.com/rai-project/utils,v0.0.0-20180619204045-c582bb171808,h1:cHOS6oMEt8wi93zm5V7cHVnWgOhaAUCpjRDEZHBsckg=,6d43ccc901ad2f19744696f6c3d04ee28b4496cef7fe72ce7eccb89af0d8bfac
+github.com/rai-project/vipertags,v0.0.0-20190404224953-d63b0a674aa9,h1:3o86f/tK0DBZdPcUBjzFu1mEZsRCzjSgi5PNHope4AQ=,9aa8cdd1a3369382d28bad0f4581250fbecae51602aa8566cbe68dfadc8f7785
+github.com/raintank/schema,v1.0.0,h1:tK0zKHceZd5nkCUI5Soip1pA2BAvoc4qzloVEsK0y+Q=,9ffc30e882b1cfed3152bab9c8c95e00c984dc0d8895426c95d96a184e09ffe3
+github.com/rainycape/memcache,v0.0.0-20150622160815-1031fa0ce2f2,h1:dq90+d51/hQRaHEqRAsQ1rE/pC1GUS4sc2rCbbFsAIY=,2d42bb018c6b0531f93e2dc862c87374966c64c9a88863612ab5e676a32661fa
+github.com/rainycape/unidecode,v0.0.0-20150907023854-cb7f23ec59be,h1:ta7tUOvsPHVHGom5hKW5VXNc2xZIkfCKP8iaqOyYtUQ=,0ab56010a3ef93c20bb6d8c486e3b447b4004052053e280ea6eabf2a5138bdce
+github.com/rakyll/statik,v0.1.6,h1:uICcfUXpgqtw2VopbIncslhAmE5hwc4g20TEyEENBNs=,58cc0c07f8e9dd17ad5c4e0f89c03d8a3ed420aac0e76b79adf7ebd1d48c5893
+github.com/rcrowley/go-metrics,v0.0.0-20190826022208-cac0b30c2563,h1:dY6ETXrvDG7Sa4vE8ZQG4yqWg6UnOcbqTAahkV813vQ=,22e944d960aec1a1e62e8cc2daaa70abefbbe989dd9c233060ab533de5f6e724
+github.com/remyoudompheng/bigfft,v0.0.0-20190512091148-babf20351dd7,h1:FUL3b97ZY2EPqg2NbXKuMHs5pXJB9hjj1fDHnF2vl28=,73f78c7e36c32822221f9f676b65ebe7ccb92ab6ff221035ace35c184e165c0d
+github.com/renier/xmlrpc,v0.0.0-20170708154548-ce4a1a486c03,h1:Wdi9nwnhFNAlseAOekn6B5G/+GMtks9UKbvRU/CMM/o=,f9c07652c6de1aecf5baaa3b93c1e6c23379458e30553400d5f96ac8b3ea85c4
+github.com/renstrom/fuzzysearch,v0.0.0-20160331204855-2d205ac6ec17,h1:4qPms2txLWMLXKzqlnYSulKRS4cS9aYgPtAEpUelQok=,01782a5d1682a72614126da402171253030c0de60485bc18a3e63b07d977c094
+github.com/retr0h/go-gilt,v0.0.0-20190206215556-f73826b37af2,h1:vZ42M1tDiMLtirFA1K5k2QVFhWRqR4BjdSw0IMclzH4=,e7956b01b3ccea41395f1f641a0f9045f214c1075d7ecc25553b72383009274e
+github.com/revel/config,v0.21.0,h1:Bw4iXLGAuD/Di2HEhPSOyDywrTlFIXUMbds91lXTtTU=,22842698f6c646b9b89649b432d0f24deae1c5a3779c49819ec99c5db6e4b5a0
+github.com/revel/log15,v2.11.20+incompatible,h1:JkA4tbwIo/UGEMumY50zndKq816RQW3LQ0wIpRc+32U=,28e4263b0320a07dd2ae71ba09aef1f9b4af44258a8c0f1dfb1d63300f93c401
+github.com/revel/pathtree,v0.0.0-20140121041023-41257a1839e9,h1:/d6kfjzjyx19ieWqMOXHSTLFuRxLOH15ZubtcAXExKw=,de658b8de908c9c090343447e66e6bbdfe99656fcfa5889997486b0594c2a719
+github.com/revel/revel,v0.21.0,h1:E6kDJmpJSDb0F8XwbyG5h4ayzpZ+8Wcw2IiPZW/2qSc=,c66570c338f37e95626646909af1086f0bf31d8432fe982d24c415d14bc1dc9c
+github.com/rivo/tview,v0.0.0-20191018125527-685bf6da76c2,h1:GVXSfgXOMAeLvFH7IrpY3yYM8H3YekZEFcZ14q9gQXM=,000538d9517bd5f28cfe377e63183f7093043acf8bb913eb493adb29518eb6b8
+github.com/rivo/uniseg,v0.1.0,h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY=,cb701df81f36acfbb2627a78662fdcaa150ee1ac00d0796a7f3eafbdb6218128
+github.com/rjeczalik/notify,v0.9.2,h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8=,e8b9b93870f7ed17f30c617acb55f5fa78e7931518c88999c3d1b5b048f51482
+github.com/rkt/rkt,v1.30.0,h1:ZI5RQtSibfjicSttV/HLiHuWreYClEJA2Or5XKAdJb0=,ca2e00335dbeae7e0fbe2c45535d2bb8fce72c2bb6045b0bdf25bc6b8b59179e
+github.com/robertkrimen/otto,v0.0.0-20180617131154-15f95af6e78d,h1:1VUlQbCfkoSGv7qP7Y+ro3ap1P1pPZxgdGVqiTVy5C4=,7adbe73b0db5319bae0421a0ed7fc5619002d6e9a2be87dc8c673c8541dfd949
+github.com/robfig/cron,v1.2.0,h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=,0811a1a5a4e1f45824ac520deb2002326a659dbb4918cdfea47d80560a23211d
+github.com/robfig/cron/v3,v3.0.0,h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E=,5e29b4f7f4ba62293420b918fb2309823523a583c2adaf6eddb059f525f05496
+github.com/rogpeppe/fastuuid,v1.2.0,h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s=,f9b8293f5e20270e26fb4214ca7afec864de92c73d03ff62b5ee29d1db4e72a1
+github.com/rogpeppe/go-charset,v0.0.0-20180617210344-2471d30d28b4,h1:BN/Nyn2nWMoqGRA7G7paDNDqTXE30mXGqzzybrfo05w=,a28b06534aa71873d08578d69b08512dab54caa0ffd9e2943b3479166049eddd
+github.com/rogpeppe/go-internal,v1.4.0,h1:LUa41nrWTQNGhzdsZ5lTnkwbNjj6rXTdazA1cSdjkOY=,fb7d843253301d3ea9793f90e6bea16a8f2970a01b361f490ee66b36f81e03a5
+github.com/rpcx-ecosystem/quic-conn,v0.0.0-20190920095804-3967ef162525,h1:Awv5A28rrxuHf1+9+N08cnBa6JuKbhHswmNdfj65Bzo=,b40886ad7129eff9e517187b527467330db3705207349cdaa8f35c0dc8445c08
+github.com/rs/cors,v1.7.0,h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=,67815316761fddc4acfaad852965cf04ec88674abe3a05c6c332519556c55855
+github.com/rs/xhandler,v0.0.0-20160618193221-ed27b6fd6521,h1:3hxavr+IHMsQBrYUPQM5v0CgENFktkkbg1sfpgM3h20=,665ae95533e1a046cf470c7341c59e64b3e2a795cdaaf307368f69a0ba547f2c
+github.com/rs/xid,v1.2.1,h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc=,4abdedc4de69adcb9a4575f99c59d8ab542191e1800b6a91e12a4e9ea8da0026
+github.com/rs/zerolog,v1.16.0,h1:AaELmZdcJHT8m6oZ5py4213cdFK8XGXkB3dFdAQ+P7Q=,64e248c1fa3c62e2d904868b49acf906d0cb04a00a323d2562ea9ce7c6f154e1
+github.com/rubenv/sql-migrate,v0.0.0-20191025130928-9355dd04f4b3,h1:lwDYefgiwhjuAuVnMVUYknoF+Yg9CBUykYGvYoPCNnQ=,4d4e9e2c7387542b26a1cd9fbfcbdab7b75dce807877d5a0a501180b584c60f2
+github.com/rubyist/circuitbreaker,v2.2.1+incompatible,h1:KUKd/pV8Geg77+8LNDwdow6rVCAYOp8+kHUyFvL6Mhk=,fc1125d9260a471d349c94a251340c437f98743b42324706482596f303c28b11
+github.com/russross/blackfriday,v2.0.0+incompatible,h1:cBXrhZNUf9C+La9/YpS+UHpUT8YD6Td9ZMSU9APFcsk=,836047aa9cbd223efba85b892e6897cf7a3b5ee3f2e6ad36b189d40842f703df
+github.com/russross/blackfriday/v2,v2.0.1,h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=,496079bbc8c4831cd0507213e059a925d2c22bd1ea9ada4dd85815d51b485228
+github.com/rwcarlsen/goexif,v0.0.0-20190401172101-9e8deecbddbd,h1:CmH9+J6ZSsIjUK3dcGsnCnO41eRBOnY12zwkn5qVwgc=,98e8ce7bf484716bdf272f31ee01354599f4ec4b4ece7c04156c15b264d8f6ec
+github.com/ryanuber/columnize,v2.1.0+incompatible,h1:j1Wcmh8OrK4Q7GXY+V7SVSY8nUWQxHW5TkBe7YUl+2s=,ff687e133db2e470640e511c90cf474154941537a94cd97bb0cf7a28a7d00dc7
+github.com/ryanuber/go-glob,v1.0.0,h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=,2084f36ead38a505489fdb46329502fb627f568224dcc22ef11ec173b61fc2cf
+github.com/ryszard/goskiplist,v0.0.0-20150312221310-2dfbae5fcf46,h1:GHRpF1pTW19a8tTFrMLUcfWwyC0pnifVo2ClaLq+hP8=,12c65729fc31d5a9bf246eb387bd4c268d0d68bf33b913cccd81bebd47d6f80d
+github.com/sacloud/libsacloud,v1.26.1,h1:td3Kd7lvpSAxxHEVpnaZ9goHmmhi0D/RfP0Rqqf/kek=,4f0e24194ce3566707df5862177cb0f697debe3d5b799decb2685ee8d07dbe11
+github.com/saintfish/chardet,v0.0.0-20120816061221-3af4cd4741ca,h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI=,d9cb0e35c88fbf91a409db0626f2e8ae9db305cf95dc3469dc7d089a8432c9c3
+github.com/samuel/go-zookeeper,v0.0.0-20190923202752-2cc03de413da,h1:p3Vo3i64TCLY7gIfzeQaUJ+kppEO5WQG3cL8iE8tGHU=,499f8144de8a6839b2d70c8869d88f294604188ec501e928ca17446043147d40
+github.com/sanity-io/litter,v1.1.0,h1:BllcKWa3VbZmOZbDCoszYLk7zCsKHz5Beossi8SUcTc=,c4bbddbf1bd7bb4ef74a3c2cac98f4a78a2a3a5a6b8dd140bd31a5d38c459217
+github.com/santhosh-tekuri/jsonschema,v1.2.4,h1:hNhW8e7t+H1vgY+1QeEQpveR6D4+OwKPXCfD2aieJis=,1c946415ee3395181090664a37779c296b540ca7eec58844ad0283fef11fec00
+github.com/sasha-s/go-deadlock,v0.2.0,h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73DK8Y=,6c3f90c7947da1090f545438f4b3fd461cfeec79ee1c6e5e83a0eed7258622b1
+github.com/sassoftware/go-rpmutils,v0.0.0-20190420191620-a8f1baeba37b,h1:+gCnWOZV8Z/8jehJ2CdqB47Z3S+SREmQcuXkRFLNsiI=,88264dbd268c88bc8a57e4b4a261f22058fa6e03eb2883b0a82375f854e15188
+github.com/satori/go.uuid,v1.2.0,h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=,4f741306a0cbe97581e34a638531bcafe3c2848150539a2ec2ba12c5e3e6cbdd
+github.com/satori/uuid,v1.2.0,h1:6TFY4nxn5XwBx0gDfzbEMCNT6k4N/4FNIuN8RACZ0KI=,bfd4d3d619e3ad4dd915e05fec5bf10949d8af9bc5c19b840db35ec0f21172ad
+github.com/scaleway/scaleway-cli,v0.0.0-20180921094345-7b12c9699d70,h1:DaqC32ZwOuO4ctgg9qAdKnlQxwFPkKmCOEqwSNwYy7c=,05566d6711de08738803132b8522f7051fccd3b3bf2c739dde421fffdfa75eaf
+github.com/sclevine/agouti,v3.0.0+incompatible,h1:8IBJS6PWz3uTlMP3YBIR5f+KAldcGuOeFkFbUWfBgK4=,b20c8a6a2c1fda0ae6a9cd6d319e78a7a5afea4bc90810cd46b99246d8219d23
+github.com/sclevine/spec,v1.2.0,h1:1Jwdf9jSfDl9NVmt8ndHqbTZ7XCCPbh1jI3hkDBHVYA=,582017cd824cf3cdf6803ec7db2250304f66efea705feb69cbabab416928b8f4
+github.com/sean-/conswriter,v0.0.0-20180208195008-f5ae3917a627,h1:Tn2Iev07a4oOcAuFna8AJxDOF/M+6OkNbpEZLX30D6M=,0637d2fc0eb4627827e4b73dbe3a72479708641df8fc71a06e7bc481f6a7f39b
+github.com/sean-/pager,v0.0.0-20180208200047-666be9bf53b5,h1:D07EBYJLI26GmLRKNtrs47p8vs/5QqpUX3VcwsAPkEo=,a4288f9116ea01c34efd65b7dce4357ba6f9c02ad984ca758fea0d0aebb605c9
+github.com/sean-/seed,v0.0.0-20170313163322-e2103e2c3529,h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=,0bc8e6e0a07e554674b0bb92ef4eb7de1650056b50878eed8d5d631aec9b6362
+github.com/sebest/xff,v0.0.0-20150611211316-7a36e3a787b5,h1:MqIPVG2sHTgcQxFwZ+iHZSQ869PVP42SgEEeI1+X4Y8=,8cbe518a78ab7998550c509bd9fadc95a1aef8e86b1022cb3d265348ad370cde
+github.com/seccomp/libseccomp-golang,v0.9.1,h1:NJjM5DNFOs0s3kYE1WUOr6G8V97sdt46rlXTMfXGWBo=,5989692d87ef4c377fbc60d441795a90d9453b9e357d019e44d9033ab39ca888
+github.com/segmentio/go-loggly,v0.5.1-0.20171222203950-eb91657e62b2,h1:S4OC0+OBKz6mJnzuHioeEat74PuQ4Sgvbf8eus695sc=,5e071d0b6923a0fa78895bf7e673f5a4e482d39d4603b7dabd4056a506923ca7
+github.com/segmentio/go-prompt,v1.2.1-0.20161017233205-f0d19b6901ad,h1:EqOdoSJGI7CsBQczPcIgmpm3hJE7X8Hj3jrgI002whs=,b86fcda4b8afd5a3893ea333431368e60ea5ebee302a3014aee6d2020233bf31
+github.com/segmentio/kafka-go,v0.1.0,h1:IXCHG+sXPNiIR5pC/vTEItZduPKu4cnpr85YgxpxlW0=,e0b749b974d3277438d09dd6178928c3ad6c3760313f7ad45ec5cd88d8eb14b9
+github.com/serenize/snaker,v0.0.0-20171204205717-a683aaf2d516,h1:ofR1ZdrNSkiWcMsRrubK9tb2/SlZVWttAfqUjJi6QYc=,67272dde9cf92af80704869dea59346be1c37098373200dd8eea6e0e034079b4
+github.com/sergi/go-diff,v1.0.0,h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=,287218ffcd136dbb28ce99a2f162048d8dfa6f97b524c17797964aacde2f8f52
+github.com/serialx/hashring,v0.0.0-20180504054112-49a4782e9908,h1:RRpyb4kheanCQVyYfOhkZoD/cwClvn12RzHex2ZmHxw=,4184e14faf8e39222109eb2b7fa3aee2e0a544b66785ad0b7058318483ff76bb
+github.com/sethgrid/pester,v0.0.0-20190127155807-68a33a018ad0,h1:X9XMOYjxEfAYSy3xK1DzO5dMkkWhs9E9UCcS1IERx2k=,ddcaf31e63aaf1ac003af97e667bedaa0fc89956e19aeb032c5658629da29800
+github.com/shiena/ansicolor,v0.0.0-20151119151921-a422bbe96644,h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo=,60da6dc53662eb72063784f3bf609edb7aa317c552f81651164bc657754902a6
+github.com/shirou/gopsutil,v2.19.10+incompatible,h1:lA4Pi29JEVIQIgATSeftHSY0rMGI9CLrl2ZvDLiahto=,e5afa6f0b690ecc3ff12458663c6337920a759f27c3d9692a0836644337e4e85
+github.com/shirou/w32,v0.0.0-20160930032740-bb4de0191aa4,h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U=,3ed6741a7e1470feffb50031ecf9919f30b5f573f993683b6574488756ef65c1
+github.com/shopspring/decimal,v0.0.0-20191009025716-f1972eb1d1f5,h1:Gojs/hac/DoYEM7WEICT45+hNWczIeuL5D21e5/HPAw=,91a0ee539fb6f3de1550cdf93c73434fc8a16bab37be693997b20317510331a9
+github.com/shurcooL/component,v0.0.0-20170202220835-f88ec8f54cc4,h1:Fth6mevc5rX7glNLpbAMJnqKlfIkcTjZCSHEeqvKbcI=,2dd1cfac518def9fc8c6ac69022a85b0413269caf93d9532f77dca7375e1d645
+github.com/shurcooL/events,v0.0.0-20181021180414-410e4ca65f48,h1:vabduItPAIz9px5iryD5peyx7O3Ya8TBThapgXim98o=,1dcade8d00ba3945f5d1bc56c09a84e2d51fa20d20ef4fa6f867e5e4cd918e9d
+github.com/shurcooL/github_flavored_markdown,v0.0.0-20181002035957-2122de532470,h1:qb9IthCFBmROJ6YBS31BEMeSYjOscSiG+EO+JVNTz64=,d984dc45e823f4c99e89841d675e34d2d35d3b334f1b3690fde05de30a66929f
+github.com/shurcooL/githubv4,v0.0.0-20191006152017-6d1ea27df521,h1:ARaYJO1zp2afVv0s28fq7uxgee4WLop35FWrOoSZyak=,7f5c88b38760c5090bffe582a40abe7dc17a789f9041549e5c17e3d71df2d75d
+github.com/shurcooL/go,v0.0.0-20180423040247-9e1955d9fb6e,h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM=,350e4c547dbeb657bb3b2eab428f1c29a80808e8096ff87324fd84744f914766
+github.com/shurcooL/go-goon,v0.0.0-20170922171312-37c2f522c041,h1:llrF3Fs4018ePo4+G/HV/uQUqEI1HMDjCeOf2V6puPc=,31cb3f736521597c56f962b9d7d21073620fbb1da845305aba743960f09e4115
+github.com/shurcooL/gofontwoff,v0.0.0-20180329035133-29b52fc0a18d,h1:Yoy/IzG4lULT6qZg62sVC+qyBL8DQkmD2zv6i7OImrc=,685dedb79602bb41403a7b5198f5c9d0ffbc99a68d7f99160ecf08a71475e5f4
+github.com/shurcooL/gopherjslib,v0.0.0-20160914041154-feb6d3990c2c,h1:UOk+nlt1BJtTcH15CT7iNO7YVWTfTv/DNwEAQHLIaDQ=,ea6c396c92724a8028793bde957dbe9a1c594b8af085035e652d4335e6aa30e1
+github.com/shurcooL/graphql,v0.0.0-20181231061246-d48a9a75455f,h1:tygelZueB1EtXkPI6mQ4o9DQ0+FKW41hTbunoXZCTqk=,eb1b45dc90aed0edcfc4cacffdc2645121dda8155702440eada1bcafefddcbba
+github.com/shurcooL/highlight_diff,v0.0.0-20170515013008-09bb4053de1b,h1:vYEG87HxbU6dXj5npkeulCS96Dtz5xg3jcfCgpcvbIw=,b4bcb7f3e50a99623d5f39c4e054964fc60d5e4b34543408582a0a984a67b630
+github.com/shurcooL/highlight_go,v0.0.0-20181028180052-98c3abbbae20,h1:7pDq9pAMCQgRohFmd25X8hIH8VxmT3TaDm+r9LHxgBk=,9f879b051c8eadb6dc063ca3ff6856d0e64cd30b5ad545e580b77b4f8ef9ddd7
+github.com/shurcooL/home,v0.0.0-20181020052607-80b7ffcb30f9,h1:MPblCbqA5+z6XARjScMfz1TqtJC7TuTRj0U9VqIBs6k=,0042d859afa3221fd4b4049b350a2d6ffcc674e4c4177bb0c232dc120b410ee6
+github.com/shurcooL/htmlg,v0.0.0-20190503024804-b6326af49ef6,h1:kXXs9Xnfv5gU7KLKiOE3AQgaRUUXchcXnO2rP3fZ5Ao=,52485f17bba8920b37a70124b90eea9d43037a9764a785c97a7e531ca09ed5a5
+github.com/shurcooL/httperror,v0.0.0-20190506043526-2e76094aa70e,h1:QTph/PpT1aDtFHk0sVJoVG/Vfox0YZkq70sW/tvXJM0=,7807129d1577611bdf803b7a4dd3253f45e4b63a77c1a73bed48a0c838c463c6
+github.com/shurcooL/httpfs,v0.0.0-20190707220628-8d4bc4ba7749,h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk=,a2079dbd8c236262ecbb22312467265fbbddd9b5ee789531c5f7f24fbdda174b
+github.com/shurcooL/httpgzip,v0.0.0-20190720172056-320755c1c1b0,h1:mj/nMDAwTBiaCqMEs4cYCqF7pO6Np7vhy1D1wcQGz+E=,70ef73fce2f89d622f828cb439fd6c7b48a7fe63600410a8c0a936042c0e4631
+github.com/shurcooL/issues,v0.0.0-20190705005435-6a96395fbb66,h1:kls/E9JqtKEj8tWx2PwKCWqEWmwzsX7cnj9QkaEhUpM=,dd1ace2ad69b6c130a9294c3eb4032090e73c3b7dace098a5a7e1ad154f8e911
+github.com/shurcooL/issuesapp,v0.0.0-20180602232740-048589ce2241,h1:Y+TeIabU8sJD10Qwd/zMty2/LEaT9GNDaA6nyZf+jgo=,ac947684d3f13beef9433724deddc2c7ddb6d19921d6902f4789dd4ce1af5f3c
+github.com/shurcooL/notifications,v0.0.0-20181111060504-bcc2b3082a7a,h1:bQX0+HfDylIQCtf1tzyrxQ+BqIV08ZjkjgspFWiIYhc=,c1c77700f490d0211cec00fd5fd0ee80debf66e0e41de1dc68b24dc726db5409
+github.com/shurcooL/octicon,v0.0.0-20190930024621-43309dfb482e,h1:C2+alklsN4yRHXaOX3v9TuCGlTSwZQjSnN88nLGVhg8=,88953a9951a14e24afd2d1040e9de0b4fbe194805fdc7ec9d9d9bbcd8c2f3448
+github.com/shurcooL/reactions,v0.0.0-20181222204718-145cd5e7f3d1,h1:hHIhW4KrmPQ/hJ7AuKNNvVPVE2k/LVE5NTFsQ68taBw=,fd5f9a0c6e7e292bdfa81fcad767f61c95dc84f18bf4f9f02a4fe02f75327d37
+github.com/shurcooL/sanitized_anchor_name,v1.0.0,h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=,0af034323e0627a9e94367f87aa50ce29e5b165d54c8da2926cbaffd5834f757
+github.com/shurcooL/users,v0.0.0-20180125191416-49c67e49c537,h1:YGaxtkYjb8mnTvtufv2LKLwCQu2/C7qFB7UtrOlTWOY=,3f17089e996438a88a478d38807ce4f3c045a91114830946a1bdc760eb2b7c58
+github.com/shurcooL/vfsgen,v0.0.0-20181202132449-6a9ea43bcacd,h1:ug7PpSOB5RBPK1Kg6qskGBoP3Vnj/aNYFTznWvlkGo0=,8a093681b21159514a1742b1a49e88fa2cf562673a5a0055e9abeb7ff590ee19
+github.com/shurcooL/webdavfs,v0.0.0-20170829043945-18c3829fa133,h1:JtcyT0rk/9PKOdnKQzuDR+FSjh7SGtJwpgVpfZBRKlQ=,bb70104152800cbb490c480bead0d2ef24176be9e1304e6701ab161115484863
+github.com/siddontang/go,v0.0.0-20180604090527-bdc77568d726,h1:xT+JlYxNGqyT+XcU8iUrN18JYed2TvG9yN5ULG2jATM=,ef97fabc8a96a758fac273b01dff6be7957ed44c4b6c6a8316f43741329a0049
+github.com/siddontang/go-snappy,v0.0.0-20140704025258-d8f7bb82a96d,h1:qQWKKOvHN7Q9c6GdmUteCef2F9ubxMpxY1IKwpIKz68=,faf83d6459d06f5f4a9acd09e23e284e11792d14de331bd7b87852b18f9cf5c3
+github.com/siddontang/ledisdb,v0.0.0-20190202134119-8ceb77e66a92,h1:qvsJwGToa8rxb42cDRhkbKeX2H5N8BH+s2aUikGt8mI=,dab81c0bdfc62063a340f61dfab19c065d2d10b1245cd56cc04832130a6bbea5
+github.com/siddontang/rdb,v0.0.0-20150307021120-fc89ed2e418d,h1:NVwnfyR3rENtlz62bcrkXME3INVUa4lcdGt+opvxExs=,93bf89960d84b8732e648cb413dced692c1d3d9000997e99826538a5f20b1d82
+github.com/sigurn/crc8,v0.0.0-20160107002456-e55481d6f45c,h1:hk0Jigjfq59yDMgd6bzi22Das5tyxU0CtOkh7a9io84=,12916a0da94e747b99653138a25112e24b082db53bc0d5cffe62214ce3fb884d
+github.com/sigurn/utils,v0.0.0-20190728110027-e1fefb11a144,h1:ccb8W1+mYuZvlpn/mJUMAbsFHTMCpcJBS78AsBQxNcY=,694bb4cbe9dd17447c1e0054ef327eebd9bed8682aa39f5f4d282fb9b1717299
+github.com/sirupsen/logrus,v1.4.2,h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=,9a8e55830261a4b1c9350d7c45db029c8586c0b2d934d1224cde469425031edd
+github.com/skratchdot/open-golang,v0.0.0-20190402232053-79abb63cd66e,h1:VAzdS5Nw68fbf5RZ8RDVlUvPXNU6Z3jtPCK/qvm4FoQ=,242db3338b172ecb58bdf3406b4cafecfa738cfb7b8cd71698d23831aedd94b0
+github.com/skyrings/skyring-common,v0.0.0-20160929130248-d1c0bb1cbd5e,h1:jrZSSgPUDtBeJbGXqgGUeupQH8I+ZvGXfhpIahye2Bc=,d5010d4900d7417c05d4863399e5509e82dfaca9c09c31ac9e5ebdcaf109e833
+github.com/smallnest/libkv-etcdv3-store,v0.0.0-20191101045330-f92940446965,h1:YQtdLz+7JQdKn7f5cG+xSrSbI7X4jObx0Jy6ZzffGew=,b9fb22d7d67e16cd3a1d7c7a5b2faf6c35c690ae1c3bcf70dbf77813db7dc563
+github.com/smallnest/rpcx,v0.0.0-20191101045608-2a801682117a,h1:Fzp1HLqyYg8koEELgwfSEUgkE6QPvrN9qCkHZ8tikFY=,0d2255c9ffc429e32936dbb9e51c79bbf2b76a7dec95c5d9dc1668053d5642bc
+github.com/smallnest/valkeyrie,v0.0.0-20191030064635-54a884e4b303,h1:NDOAHb1sE8pYWd0Dge8W6bGQ63FHfa0/QjClXG2hrgw=,b846d492aaf7053115b2e143b7c7696299b852ec670d261bd78b5cd996eacde3
+github.com/smartystreets/assertions,v1.0.1,h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w=,2e3d9f61f68cdf7b48653582640ef88744c1a3bdd4257ac68f621579a2f807dd
+github.com/smartystreets/go-aws-auth,v0.0.0-20180515143844-0c1422d1fdb9,h1:hp2CYQUINdZMHdvTdXtPOY2ainKl4IoMcpAXEf2xj3Q=,d9441cfbef2c680269ced67f8e1d99af9cf649e11a7f133a5b0685be0277ca7d
+github.com/smartystreets/goconvey,v0.0.0-20190731233626-505e41936337,h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8=,fd90be078397b45806e4dfaca367235aef6d6133871c8a6cc6d3d579280d8d03
+github.com/smartystreets/gunit,v1.0.0,h1:RyPDUFcJbvtXlhJPk7v+wnxZRY2EUokhEYl2EJOPToI=,36cf43529cfadeb297ce1537c7d0fca8373a95936806121ce7ce0bf653e959ee
+github.com/smola/gocompat,v0.2.0,h1:6b1oIMlUXIpz//VKEDzPVBK8KG7beVwmHIUEBIs/Pns=,7812934f407beeab20aa289b0056234ae6637b30b301ebf97a5d7a9fd8e665fc
+github.com/snikch/goodman,v0.0.0-20171125024755-10e37e294daa,h1:YJfZp12Z3AFhSBeXOlv4BO55RMwPn2NoQeDsrdWnBtY=,ab939c56cb7afcff213aef4568f40c9ddeae30166e34a2fa7f5718a47227c2e1
+github.com/softlayer/softlayer-go,v0.0.0-20180806151055-260589d94c7d,h1:bVQRCxQvfjNUeRqaY/uT0tFuvuFY0ulgnczuR684Xic=,63ad57bc2d4c27db3dcab7cf545a075bb4d7ea66aba57c284c07a2c938220f8c
+github.com/soheilhy/cmux,v0.1.4,h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=,6d6cadade0e186f84b5f8e7ddf8f4256601b21e49b0ca49fd003a7e570ae1885
+github.com/songtianyi/rrframework,v0.0.0-20180901111106-4caefe307b3f,h1:o3QHyJEW1U+8oyEZeaXFcYqdhhiZjrs25/8AZmsWjiU=,b1cf04474a48de1ed7ae535ae4a2d5b17a0df4ce0d3b953c5268f42ee34cb17d
+github.com/soniakeys/unit,v1.0.0,h1:UMIgu6dxDQaK6tYaQV6dJn5oovB6035KRxCS0O7Jiec=,565c64fe777e1140d82422e9b8d29ce8de82d7916e50dac2f7591d2c6f2d79e7
+github.com/sony/gobreaker,v0.4.1,h1:oMnRNZXX5j85zso6xCPRNPtmAycat+WcoKbklScLDgQ=,eab9bf8f98b16b051d7d13c4f5c70d6d1039347e380e0a12cb9ff6e33200d784
+github.com/sourcegraph/annotate,v0.0.0-20160123013949-f4cad6c6324d,h1:yKm7XZV6j9Ev6lojP2XaIshpT4ymkqhMeSghO5Ps00E=,2a58cbf2485b2e97e49d7c3e83e81385d1418bfbab2b846dabec041a3d402b3e
+github.com/sourcegraph/syntaxhighlight,v0.0.0-20170531221838-bd320f5d308e,h1:qpG93cPwA5f7s/ZPBJnGOYQNK/vKsaDaseuKT5Asee8=,c0e6323ed7a5dcddcdd7686f2d7c68dff44a8ecbfd6818db3bdb33a7af422792
+github.com/spacemonkeygo/errors,v0.0.0-20171212215202-9064522e9fd1,h1:xHQewZjohU9/wUsyC99navCjQDNHtTgUOM/J1jAbzfw=,b360a46f9534dd46d2b2c27c84ba8bbe3942832e74aa4ceb16acaa6ba30620be
+github.com/spacemonkeygo/monotime,v0.0.0-20180824235756-e3f48a95f98a,h1:8+cCjxhToanKmxLIbuyBNe2EnpgwhiivsIaRJstDRFA=,4a55e556811ab93b23b46907b354e53fc553eb93314cf0b524933f37ac1437f8
+github.com/spacemonkeygo/openssl,v0.0.0-20181017203307-c2dcc5cca94a,h1:/eS3yfGjQKG+9kayBkj0ip1BGhq6zJ3eaVksphxAaek=,23031c8d37bbaa5aace338eed65af68c7d72bf134d7d0e09c963ed4974c56e58
+github.com/spacemonkeygo/spacelog,v0.0.0-20180420211403-2296661a0572,h1:RC6RW7j+1+HkWaX/Yh71Ee5ZHaHYt7ZP4sQgUrm6cDU=,91eb98e80c44d42e6f3ff7ddf84f825d20eb55669452d752fb8ed3adeb723be7
+github.com/spaolacci/murmur3,v1.1.0,h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=,60bd43ada88cc70823b31fd678a8b906d48631b47145300544d45219ee6a17bc
+github.com/spf13/afero,v1.2.2,h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=,81d51799397212c9adb2cea6cf3a96a2b50f1baff8aff7bd410128a84f2a9e73
+github.com/spf13/cast,v1.3.0,h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=,001ed519a3ec007e76e639f72bd9560be70497d499acbf1a32ccf32dc4647d91
+github.com/spf13/cobra,v0.0.5,h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s=,6c6739f11d69fa1e5b60ba1e04529f355f8a30e1aa2b137ba26260de8fa7a647
+github.com/spf13/fsync,v0.9.0,h1:f9CEt3DOB2mnHxZaftmEOFWjABEvKM/xpf3cUwJrGOY=,d470c73c6e821d6c8f47ce05be3360f4d686d9079dd5af1585420c73e4725c56
+github.com/spf13/jwalterweatherman,v1.1.0,h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=,43cc5f056caf66dc8225dca36637bfc18509521b103a69ca76fbc2b6519194a3
+github.com/spf13/pflag,v1.0.5,h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=,fc6e704f2f6a84ddcdce6de0404e5340fa20c8676181bf5d381b17888107ba84
+github.com/spf13/viper,v1.5.0,h1:GpsTwfsQ27oS/Aha/6d1oD7tpKIqWnOA6tgOX9HHkt4=,7f3513d0a1186b765937c788f0ac751076067b7a0abc82420171b6f262787ac5
+github.com/src-d/envconfig,v1.0.0,h1:/AJi6DtjFhZKNx3OB2qMsq7y4yT5//AeSZIe7rk+PX8=,c694b1440b6969dfd4ebcba669faea8a05bdc7791ac78dcfbe29f153b0a8f0cd
+github.com/src-d/gcfg,v1.4.0,h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4=,2aa52404cbeec89c0a976d333448d1a4a6e113f03e000a715ce9006c84eb2e32
+github.com/srwiley/oksvg,v0.0.0-20190829233741-58e08c8fe40e,h1:LJUrNHytcMXWKxnULIHPe5SCb1jDpO9o672VB1x2EuQ=,e29e85accb2169d2f0f4dc90c22c446c24d244d68e0bbe038ba9df63381916c5
+github.com/srwiley/rasterx,v0.0.0-20181219215540-696f7edb7a7e,h1:FFotfUvew9Eg02LYRl8YybAnm0HCwjjfY5JlOI1oB00=,8a4b0686258a3e1b4f8b3e5f25efbaaefe7919d4e47e89eb36a6779504f8b116
+github.com/ssdb/gossdb,v0.0.0-20180723034631-88f6b59b84ec,h1:q6XVwXmKvCRHRqesF3cSv6lNqqHi0QWOvgDlSohg8UA=,2c20531d93416fa34ee9039308166c869c72c16fff715c73c05a3977157fdc2d
+github.com/ssor/bom,v0.0.0-20170718123548-6386211fdfcf,h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo=,7622ce25bbc5d5376ccb113f267f3d68bf2363963b02d04c053dfbc252f62c4a
+github.com/steakknife/bloomfilter,v0.0.0-20180922174646-6819c0d2a570,h1:gIlAHnH1vJb5vwEjIp5kBj/eu99p/bl0Ay2goiPe5xE=,fb001f6df1197d462e7dfdbeded863aebd85bb904da5075117174a027a1b8cb1
+github.com/steakknife/hamming,v0.0.0-20180906055917-c99c65617cd3,h1:njlZPzLwU639dk2kqnCPPv+wNjq7Xb6EfUxe/oX0/NM=,e42bd1bc7073772613c2b4879110dd5330fded46a8cdf9269ff03cb6a82d1108
+github.com/stellar/go,v0.0.0-20191031165136-ed88b67b723d,h1:0pucQZ9fngYUl/tIGO/H96N3F5NL5ySjM3fuz+XEFSY=,d9d23bd5fc8cae6e65d4bb0d87e3cb582bc684eac1a519ca787b187a175999a5
+github.com/stellar/go-xdr,v0.0.0-20180917104419-0bc96f33a18e,h1:n/hfey8pO+RYMoGXyvyzuw5pdO8IFDoyAL/g5OiCesY=,5122e57a861bd0c38a3a3607f13576a150face8cacf9cafaf24e21e38a104b87
+github.com/stellar/throttled,v2.2.3-0.20190823235211-89d75816f59d+incompatible,h1:jMXXAcz6xTarGDQ4VtVbtERogcmDQw4RaE85Cr9CgoQ=,a89e929d8d8ba24e621c479708378263714861d8fce137085108da9f0cc8805a
+github.com/steveyen/gtreap,v0.0.0-20150807155958-0abe01ef9be2,h1:JNEGSiWg6D3lcBCMCBqN3ELniXujt+0QNHLhNnO0w3s=,64b6a1f094784f1a843a6787bd159a103b9bebd2e85cc09a7e8445cc9e3ffc03
+github.com/streadway/amqp,v0.0.0-20190827072141-edfb9018d271,h1:WhxRHzgeVGETMlmVfqhRn8RIeeNoPr2Czh33I4Zdccw=,66bd109504bf565a4a777c20a8cf6a1c5d05cd87b59baa50da8b6f2b0da4c494
+github.com/stretchr/objx,v0.2.0,h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=,5517d43cfb7e628b9c2c64010b934e346cd24726e3d6eaf02b7f86e10752e968
+github.com/stretchr/testify,v1.4.0,h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=,0400c42ab95389bb4f4577bc09917a040a97f0f4251db2a54a7f6f5e65065b73
+github.com/stripe/stripe-go,v66.1.1+incompatible,h1:D8qUD1rxv+RdXi2qo+IdDELkDevxYUQDfje20bGQPiw=,471de64dbc99da2b83fc1822ff9b4627b1b0738a8e3ee9ffb038510ce84e4baf
+github.com/struCoder/pidusage,v0.1.2,h1:fFPTThlcWFQyizv3xKs5Lyq1lpG5lZ36arEGNhWz2Vs=,6ae03cd6cab9014ca7c0326fc233b27d942556c9753d2da87a93dd0fecbb9986
+github.com/stumble/gorocksdb,v0.0.3,h1:9UU+QA1pqFYJuf9+5p7z1IqdE5k0mma4UAeu2wmX8kA=,8bf18874189196133dabeb8fb7444633a0961e8983f8b2d8588d522d6aa679de
+github.com/subosito/gotenv,v1.2.0,h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=,21474df92536f36de6f91dfbf466995289445cc4e5a5900d9c40ae8776b8b0cf
+github.com/svanharmelen/jsonapi,v0.0.0-20180618144545-0c0828c3f16d,h1:Z4EH+5EffvBEhh37F0C0DnpklTMh00JOkjW5zK3ofBI=,482b13f426a15f3cb64ae5cb1a5fd2f27ca142465a174e24a2cc356812a3ed28
+github.com/swaggo/files,v0.0.0-20190704085106-630677cd5c14,h1:PyYN9JH5jY9j6av01SpfRMb+1DWg/i3MbGOKPxJ2wjM=,e1fe1ffca3a181bede3787e75797345bc69a583a67d8bb10b934f7a140516162
+github.com/swaggo/gin-swagger,v1.2.0,h1:YskZXEiv51fjOMTsXrOetAjrMDfFaXD79PEoQBOe2W0=,7ba6476ca79affa95429821a187b7cb3458305737ac2d1b86340814c3f276f71
+github.com/swaggo/swag,v1.6.3,h1:N+uVPGP4H2hXoss2pt5dctoSUPKKRInr6qcTMOm0usI=,1adbe98538a3f1b5e64fdf08f86cea4502a2c0d0cf1b047a27af6acf764f8c17
+github.com/syndtr/gocapability,v0.0.0-20180916011248-d98352740cb2,h1:b6uOv7YOFK0TYG7HtkIgExQo+2RdLuwRft63jn2HWj8=,ece41bcca6ca06202649ccee0d2ab62667217ceb70f3a84794c3751c16b75cee
+github.com/syndtr/goleveldb,v1.0.1-0.20190318030020-c3a204f8e965,h1:1oFLiOyVl+W7bnBzGhf7BbIv9loSFQcieWWYIjLqcAw=,b0dbd1bdec73ea70eb1db85322046d202bcbfe901bc821d6a50ffc182c276306
+github.com/tarm/serial,v0.0.0-20180830185346-98f6abe2eb07,h1:UyzmZLoiDWMRywV4DUYb9Fbt8uiOSooupjTq10vpvnU=,cd962b3b9ef46158abad455c95ed92f2632cdb9217df2b7690171cc3db507add
+github.com/tatsushid/go-fastping,v0.0.0-20160109021039-d7bb493dee3e,h1:nt2877sKfojlHCTOBXbpWjBkuWKritFaGIfgQwbQUls=,1c25333d4ca05ca13828835e07876c0efdd90a1c32a715527aa722b3c63c2d48
+github.com/tchap/go-patricia,v2.3.0+incompatible,h1:GkY4dP3cEfEASBPPkWd+AmjYxhmDkqO9/zg7R0lSQRs=,19db63cf16ba944ea853c18397e4336342f1e95e4b2cb12127405bb64c67cf73
+github.com/tdewolff/minify,v2.3.6+incompatible,h1:2hw5/9ZvxhWLvBUnHE06gElGYz+Jv9R4Eys0XUzItYo=,8cabb8163bd65e43b42c5842b700d55e2daeae60c82b019007aceb1ae63638d5
+github.com/tdewolff/minify/v2,v2.5.2,h1:If/q1brvT+91oWiWnIMEGuFcwWtpB6AtLTxba78tvMs=,0af37ec252d094917a1ff4178659fe9f4539fdc3dca108bbeb9c0c2f86499eb9
+github.com/tdewolff/parse,v2.3.4+incompatible,h1:x05/cnGwIMf4ceLuDMBOdQ1qGniMoxpP46ghf0Qzh38=,f290dda8150ebdc2b9586f509770a6c82093ac9027329aeb9f3004a0b26de8e9
+github.com/tdewolff/parse/v2,v2.3.9,h1:d8/K6XOLy5JVpLTG9Kx+SxA72rlm5OowFmVSVgtOlmM=,5f517cbecd071b97ed822e8f88f96ba7d8b5a8accc49fc515298210ac088e7ef
+github.com/tdewolff/test,v1.0.4,h1:ih38SXuQJ32Hng5EtSW32xqEsVeMnPp6nNNRPhBBDE8=,807205136d8f39bb7533d10b72932a183f15b45c385cd5464ae9d06e4af43337
+github.com/tealeg/xlsx,v1.0.5,h1:+f8oFmvY8Gw1iUXzPk+kz+4GpbDZPK1FhPiQRd+ypgE=,ff32f4336aed03df7c9cb7a4df9f1f42a1c64fe5d17c34566159511943d24bde
+github.com/tecbot/gorocksdb,v0.0.0-20181010114359-8752a9433481,h1:HOxvxvnntLiPn123Fk+twfUhCQdMDaqmb0cclArW0T0=,26c0e94162340c7b4d1da3ee4c71ca03f9d6638711cf440d6835e1a8f07e4fb4
+github.com/technoweenie/multipartstreamer,v1.0.1,h1:XRztA5MXiR1TIRHxH2uNxXxaIkKQDeX7m2XsSOlQEnM=,5a9aff85522275b125767b746869d24f4e2f776d5031631bf6e29641d99344dc
+github.com/tedsuo/ifrit,v0.0.0-20191009134036-9a97d0632f00,h1:mujcChM89zOHwgZBBNr5WZ77mBXP1yR+gLThGCYZgAg=,1c502a5584dfbce25ff99c1a5689e2d106a138989e4a03249221ca4818674098
+github.com/tedsuo/rata,v1.0.0,h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE=,f6745fd8ef8ee098410b31b1219def2c4e86c337ba6ff1319f086419b928f134
+github.com/temoto/robotstxt,v1.1.1,h1:Gh8RCs8ouX3hRSxxK7B1mO5RFByQ4CmJZDwgom++JaA=,c37f16f826a27512b7ae683ed32be5124a0252d1c7a8c4a00fd4e27d01c563d4
+github.com/templexxx/cpufeat,v0.0.0-20180724012125-cef66df7f161,h1:89CEmDvlq/F7SJEOqkIdNDGJXrQIhuIx9D2DBXjavSU=,c29bd644943d69b238da1936593421373d2db675a0fce54090d1c8b7eab7397b
+github.com/templexxx/xor,v0.0.0-20181023030647-4e92f724b73b,h1:mnG1fcsIB1d/3vbkBak2MM0u+vhGhlQwpeimUi7QncM=,578ab42785a74d1a5dd3e65bf0979138b3a98bf877de4767b8eae5701a2342e1
+github.com/tencentcloud/tencentcloud-sdk-go,v3.0.71+incompatible,h1:9sIWfe6ZC7xoSlshYWNGicPqomK7N+CsHMa1YFWBCWU=,33a9526ee0244844270e532358a22616d821cc7f8f0638e33c60f722f84c5e42
+github.com/tendermint/btcd,v0.1.1,h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s=,1967aa3cbabfb9e9780c0371a5359cc21ed77e5673b64e7dd5b234e838c82e62
+github.com/tendermint/crypto,v0.0.0-20180820045704-3764759f34a5,h1:u8i49c+BxloX3XQ55cvzFNXplizZP/q00i+IlttUjAU=,49ad334d452402d59757d3a415602f57bd7b66962d6115262f5c7413112d61bb
+github.com/tendermint/ed25519,v0.0.0-20171027050219-d8387025d2b9,h1:zccWau0P8FELSb4HTDJ88hRo+WVNMbIbg27rFqDrhCE=,7c4a6e57c787df7c6e990c35bb31df3f4a5aa89f45c3b3df4a25dfb70c01f7e3
+github.com/tendermint/go-amino,v0.15.1,h1:D2uk35eT4iTsvJd9jWIetzthE5C0/k2QmMFkCN+4JgQ=,e91cde0d10d5a8ea6ab726fbab02ef737ba52f47e207cf675440f625153d3205
+github.com/tendermint/iavl,v0.12.2,h1:Ls5p5VINCM1HRT9g5Vvs2zmDOCU/CCIvIHzd/pZ8P0E=,a56011434929c4003fd735cbef8147e8aca3d241983c5fa7a006f5753e123020
+github.com/tendermint/tendermint,v0.32.7,h1:Szu5Fm1L3pvn3t4uQxPAcP+7ndZEQKgLie/yokM56rU=,495a31dc762d79a689ce00cdd52f66b6b4071fc2b738ce4b3d1c2a9447389ecc
+github.com/tendermint/tm-db,v0.2.0,h1:rJxgdqn6fIiVJZy4zLpY1qVlyD0TU6vhkT4kEf71TQQ=,99b7c1a00ee483b97e73126a25327b75da9a5bc6e34bf9fb1ecd6b83832fe13e
+github.com/tent/http-link-go,v0.0.0-20130702225549-ac974c61c2f9,h1:/Bsw4C+DEdqPjt8vAqaC9LAqpAQnaCQQqmolqq3S1T4=,a4fe19fdbf8fbc30fe866e2cbb8761ee179f4a83bda63a0a6d30a651f3700ec2
+github.com/terraform-providers/terraform-provider-openstack,v1.15.0,h1:adpjqej+F8BAX9dHmuPF47sUIkgifeqBu6p7iCsyj0Y=,9c7419845747d0c4e3a9432f50788d8adec7ed6fca93ec9ffbf99e8c8b1cf0c3
+github.com/testcontainers/testcontainers-go,v0.0.8,h1:71E+jJpE9dSgydCfn5aWESVM7+l8giw/DBWaTy35TTU=,bceec8989a3beb9f14802c13c496c9158509f6b4cee6f855c0fb06b01e7da150
+github.com/tevino/abool,v0.0.0-20170917061928-9b9efcf221b5,h1:hNna6Fi0eP1f2sMBe/rJicDmaHmoXGe1Ta84FPYHLuE=,924168edd97fe37d4af80990d69c1d11d06b8e9236ebae65b9b68ba0261baaf1
+github.com/tgulacsi/picago,v0.0.0-20171229130838-9e1ac2306c70,h1:elvpffAnrLcWnsunBkvTwxr+Q79bPSNT1+2/pOFkCj0=,68e0cb434718215eae670723ce9327ec16d462a6403007ca22b6af71346445c5
+github.com/thanos-io/thanos,v0.3.2,h1:gNWga6sqv5kZp6ltaA7oUIFj+tTG2ohq4W9SQ4YU6ds=,99491658e5ed421ba1563818dd7c01034803fa1e0c4e5d7c28b06f3d3ed2a570
+github.com/theplant/cldr,v0.0.0-20190423050709-9f76f7ce4ee8,h1:di0cR5qqo2DllBMwmP75kZpUX6dAXhsn1O2dshQfMaA=,214ea2cc1e66f278928d0b5b1b40a3e12358b7a71e0fa6d6ea606c4d687e8eef
+github.com/theupdateframework/notary,v0.6.1,h1:7wshjstgS9x9F5LuB1L5mBI2xNMObWqjz+cjWoom6l0=,f921dfb3d54538118367d9018d9abacc3c0c026951442140d669443977180b66
+github.com/thoj/go-ircevent,v0.0.0-20180816043103-14f3614f28c3,h1:389FrrKIAlxqQMTscCQ7VH3JAVuxb/pe53v2LBiA7z8=,32edd7a9e219bdff36d2aac0c6c5f3ac982c2daf4869e6e0718e917efb23b3de
+github.com/tiancaiamao/appdash,v0.0.0-20181126055449-889f96f722a2,h1:mbAskLJ0oJfDRtkanvQPiooDH8HvJ2FBh+iKT/OmiQQ=,a9961e6079339aec983f97fdb39d5d7258bf8d2031da68482e58e17b27a93a78
+github.com/tidwall/gjson,v1.3.3,h1:wM/XREVc9c0LbRLcNMgVcGpI16r0pbbTJpltR4jJjh0=,17da724ffc86cfb3132bd9c7ac3eb860ca43a2748be519a59aa50b436c147bc6
+github.com/tidwall/match,v1.0.1,h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=,a1b9d52b9a4c7574f46068665279522f2084be26bac71594630786f6ee9a70f2
+github.com/tidwall/pretty,v1.0.0,h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=,3b25a1a0fe7688989326aaa1ca1c74c972b30152ef2a756fbf2d217a827fc07d
+github.com/tidwall/sjson,v1.0.4,h1:UcdIRXff12Lpnu3OLtZvnc03g4vH2suXDXhBwBqmzYg=,cb47595016d45d72e6ee0f5585a86247aaeb93d9efa74e07676d32f60e8a7398
+github.com/tildeleb/cuckoo,v0.0.0-20190627040100-71059d5a2b62,h1:rXSNik45VDd1hfRLUAZwDLCY0FWvn2KlCeXjbd1yAI0=,f81f44544ec771ab630ddd5d65f4735ba2acc7619e41ccbc4bfad2473c21dc2f
+github.com/timewasted/linode,v0.0.0-20160829202747-37e84520dcf7,h1:CpHxIaZzVy26GqJn8ptRyto8fuoYOd1v0fXm9bG3wQ8=,9a3190b3751964a3d47449265d48e2d3a76b23c66a7cb402cc9bdf3d732d82b4
+github.com/tinylib/msgp,v1.1.0,h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU=,61bd58489c555b30abffbe1175565b6f8460583349118e9ee12025fd17b67ea4
+github.com/tj/assert,v0.0.0-20171129193455-018094318fb0,h1:Rw8kxzWo1mr6FSaYXjQELRe88y2KdfynXdnK72rdjtA=,59a81d1883aac9635ac15d8a6a6e0630cf0a4122328116f921289dab840374b7
+github.com/tj/cobra,v0.0.0-20160702192511-5e2db986a612,h1:eiUtRvCN5HSnOg9AyX5z5od5VWy/ukyJ2oTboInm9MM=,493ac2ac61730652fcdd0b9b4c1e0c63855666df7fcaa02821b63982a5a7ccdf
+github.com/tj/go-elastic,v0.0.0-20171221160941-36157cbbebc2,h1:eGaGNxrtoZf/mBURsnNQKDR7u50Klgcf2eFDQEnc8Bc=,a0df933432e9c7ec276cbc0edbb941375726cf5a39c663aafe0e945f9ba3079f
+github.com/tj/go-kinesis,v0.0.0-20171128231115-08b17f58cb1b,h1:m74UWYy+HBs+jMFR9mdZU6shPewugMyH5+GV6LNgW8w=,0885f4631d33a20b5447ebbe12a0d23eb5ea3394de4bbc849cfe54ad19cadb2a
+github.com/tj/go-spin,v1.1.0,h1:lhdWZsvImxvZ3q1C5OIB7d72DuOwP4O2NdBg9PyzNds=,060d09c35b1db5992747cde71ccbdaefe596ada06a6fe146e0ef10dc67d817dd
+github.com/tj/pflag,v0.0.0-20160702191705-e367e44eec04,h1:RAPJe7XUQhTjVUKvYegzhXnWkJd/1daXdoiXjvkSURU=,2156357bb17b30ccb893b8f7013168c85c1eb265b7156aca845d06fb35805257
+github.com/tjfoc/gmsm,v1.0.1,h1:R11HlqhXkDospckjZEihx9SW/2VW0RgdwrykyWMFOQU=,f8fe3c4d02f0dc90fd873278957d57c4c45f1c53b1fee3969216b67844efabb1
+github.com/tmc/grpc-websocket-proxy,v0.0.0-20190109142713-0ad062ec5ee5,h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=,dadf62266d259ffb6aa1d707892b97fa36c3f39df5cae99f54d3ef7682995376
+github.com/tomnomnom/linkheader,v0.0.0-20180905144013-02ca5825eb80,h1:nrZ3ySNYwJbSpD6ce9duiP+QkD3JuLCcWkdaehUS/3Y=,558504ea96d4312be0fe5faa6de13fb6abd8f1b2ac154123c67b623a5f219cdb
+github.com/toqueteos/webbrowser,v1.2.0,h1:tVP/gpK69Fx+qMJKsLE7TD8LuGWPnEV71wBN9rrstGQ=,1227d3ebeab16d8232a304a10b087984a96ad30f7439b6687bab2f5747d308cf
+github.com/transip/gotransip,v0.0.0-20190812104329-6d8d9179b66f,h1:clyOmELPZd2LuFEyuo1mP6RXpbAW75PwD+RfDj4kBm0=,38b593cbdeb59e64d042533c1ce6196d89662de3282373de0d3c0749fe4c4856
+github.com/trivago/tgo,v1.0.5,h1:ihzy8zFF/LPsd8oxsjYOE8CmyOTNViyFCy0EaFreUIk=,06dc60662735374365cd525e2f4f4d1580f348125546e1f3e0d92d2deca4fa9a
+github.com/tstranex/u2f,v1.0.0,h1:HhJkSzDDlVSVIVt7pDJwCHQj67k7A5EeBgPmeD+pVsQ=,325e3db32035ce38a5981bfaa35fb6d9b5cb4b960cfa0285b92448d21d29f379
+github.com/tsuru/config,v0.0.0-20180418191556-87403ee7da02,h1:mHuZ6JOixltE9fJmS+W1xLi4t/uDuR6Nl7w/e4uj0+I=,0255268934770d67b9d101a030ed7ed578938e346a279a273ab3983b0eee53fb
+github.com/ttacon/chalk,v0.0.0-20160626202418-22c06c80ed31,h1:OXcKh35JaYsGMRzpvFkLv/MEyPuL49CThT1pZ8aSml4=,325521131515e4840e0083bc62cd9553da0b8d2480820f7e92ca89ae324f4c23
+github.com/tus/tusd,v1.0.1,h1:jb0SDf8zCUvlWv5SuHalOuRn684aW6WIvhfWRHC/XB8=,9a91d59123262b9bb1c43d39588a26d7560513b9e3c18254cd321890e8975083
+github.com/tv42/httpunix,v0.0.0-20150427012821-b75d8614f926,h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8=,8246ebc82e0d9d3142f5aeb50d4fcd67f3f435fb5464120c356a4e5d57ef4aa0
+github.com/twinj/uuid,v1.0.0,h1:fzz7COZnDrXGTAOHGuUGYd6sG+JMq+AoE7+Jlu0przk=,842c314d6d2ef9cb95b0f3f1b4cf998715680e836cfab8c2a7f75e351765a345
+github.com/twitchtv/twirp,v5.8.0+incompatible,h1:DTfGS9u/jHbo34cBB+qhzVHRaAq+tRois71j8pvjQ5M=,a4137792083eedd9ac04e88918d8952a841120b11e71161d2d444065b8e65d79
+github.com/tyler-smith/go-bip39,v1.0.2,h1:+t3w+KwLXO6154GNJY+qUtIxLTmFjfUmpguQT1OlOT8=,6173ded455fa17cddd889bf3bc123be2343a09aeb60f83e2b63823dd9ce94e09
+github.com/tylerb/graceful,v1.2.15,h1:B0x01Y8fsJpogzZTkDg6BDi6eMf03s01lEKGdrv83oA=,770bd36defb9463ebe8b190f508e47c37bbb6bedf23a32c675066f8edbd7aa8d
+github.com/u-root/dhcp4,v0.0.0-20190206235119-03363dc71ec8,h1:F9cRXeXZ95CzG7352mm+yfgloHFrjpr1L+CQFiCH/iU=,1db09816d65071cfc5dbf25d5dbf11b2b48c3442495d30777cc0714bb4cf4163
+github.com/u-root/u-root,v6.0.0+incompatible,h1:YqPGmRoRyYmeg17KIWFRSyVq6LX5T6GSzawyA6wG6EE=,f3ec29d4b285e50d7b3116e121caca0d722535346a0ddf189d4c7d8e7e0a07d3
+github.com/uber-go/atomic,v1.4.0,h1:yOuPqEq4ovnhEjpHmfFwsqBXDYbQeT6Nb0bwD6XnD5o=,f380292d46ebec89bf53939e4d7d19d617327cbcdf2978e30e6c39bc77df5e73
+github.com/uber/jaeger-client-go,v2.19.0+incompatible,h1:pbwbYfHUoaase0oPQOdZ1GcaUjImYGimUXSQ/+8+Z8Q=,d4928d51ce4440c825df67b4a54f851ead075701e67ece4b07fbc5c5857c091c
+github.com/uber/jaeger-lib,v2.2.0+incompatible,h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=,496f63f6df32c28ceb6574959c70969da2b609abc8f9f3b3a709466f862054bf
+github.com/uber/tchannel-go,v1.16.0,h1:B7dirDs15/vJJYDeoHpv3xaEUjuRZ38Rvt1qq9g7pSo=,64a37a5e89dd111ab943d94a1670f9addc0d2d41d34d630c95b0a756df916e01
+github.com/ucloud/ucloud-sdk-go,v0.8.7,h1:BmXOb5RivI0Uu4oZRpjI6SQ9/y7n/H9wxTGR1txIE8o=,d94766624c6f676880de354d4ed5c62c9ee7755c3d59cdf106ac0f5a070c0ece
+github.com/ugorji/go,v1.1.7,h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=,d02959e71c59b273d5b099697c058426941a862feef66c191c63e2934db7a2ff
+github.com/ugorji/go/codec,v1.1.7,h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=,8d482061c55b4c4fbf78de9fbf98a8d1b295f5904769679c73a2dc0b06a1a102
+github.com/ulikunitz/xz,v0.5.6,h1:jGHAfXawEGZQ3blwU5wnWKQJvAraT7Ftq9EXjnXYgt8=,19ebb331e7ae7a542ed58597d13ab703fc423acf93a1e3c4db86476b0322049a
+github.com/unixpickle/anyvec,v0.0.0-20170908190750-59aa66ba0472,h1:eVBSKiY98Zth6cEYVzeu0CYagakYqbSWgpWqjZFiUvI=,4159f95762f7a99ee540397e78c7a60da788e6775ad9eca7fc1bd07d332a88f1
+github.com/unixpickle/autofunc,v0.0.0-20170112172612-f27a3f82164a,h1:ZUrHljv3rPkFyTYzUmBH8gBFjDwCIHc4a2DdPCWRjl0=,b39c092ab522c2ca3e8889dfbff281223628c08590b361242e72cc29015da9df
+github.com/unixpickle/essentials,v0.0.0-20180916162721-ae02bc395f1d,h1:mRwAxGRBEFcoKSWDoX5CROMJo6xmXBh4rNqOmyhpRi0=,7aa26b2cbcbac91669e88903f1e05b7696b32a6d8194d66c0fe7d93c613c2f5f
+github.com/unixpickle/num-analysis,v0.0.0-20161229165253-c45203c63047,h1:gipJz9DZGU3fgBjoaiNg+5CG9UdE7MmlBvSwNp1ulnY=,c1dac9bfeb72d39bb0b445f0f0b2af61753e5b11ff66e69bc196886189b7d50a
+github.com/unixpickle/serializer,v0.0.0-20170723202158-c6c092dc55bb,h1:kdurEYFZ2P58xnfWtmxKWkVtFPyK80BMIaJ2zW5uskY=,2cbf6cce1b2a57307c2c675a283ce9b46adcb9d18c3a9317d3ee20772175ae40
+github.com/unknwon/com,v1.0.1,h1:3d1LTxD+Lnf3soQiD4Cp/0BRB+Rsa/+RTvz8GMMzIXs=,f6264780f210f130a0edeafe4ffb0753c64b5168771f2d6cd1613999a7b79cd1
+github.com/unrolled/render,v1.0.1,h1:VDDnQQVfBMsOsp3VaCJszSO0nkBIVEYoPWeRThk9spY=,5b0ace5c3798f8989322a32b75c3eeabce7f6568533f808065cacf92425dd867
+github.com/unrolled/secure,v0.0.0-20190103195806-76e6d4e9b90c,h1:ZY4dowVsuIAQtXXwKJ9ezfonDQ2YT7pcXRpPF2iAy3Y=,1aba4f13fe4199198f9b59bbfd337773d049bad06f68360483a5f4c5431bdce4
+github.com/urfave/cli,v1.22.1,h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY=,116fc1fba7db091617cd47c2b83c78d22489deeaf8390a6d3509da7fc9217d57
+github.com/urfave/cli/v2,v2.0.0-alpha.2,h1:2OVOKijPPhkA1cJA5SABACE8TT3Cwx9T0N6VtI8LJSI=,57250f97530fcb6fef7abc87cde3fbaf11ea45830adf98e3f1c986e2674e3b5f
+github.com/urfave/negroni,v1.0.0,h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc=,7b50615961d34d748866565b8885edd7013e33812acdbaed47502d7cc73a4bbd
+github.com/valyala/bytebufferpool,v1.0.0,h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=,7f59f32c568539afee9a21a665a4156962b019beaac8404e26ba37af056b4f1e
+github.com/valyala/fasthttp,v1.6.0,h1:uWF8lgKmeaIewWVPwi4GRq2P6+R46IgYZdxWtM+GtEY=,b15a953ed5395599871097c94977d21c026205e6ca7ad6e340cd595096d5840e
+github.com/valyala/fastrand,v1.0.0,h1:LUKT9aKer2dVQNUi3waewTbKV+7H17kvWFNKs2ObdkI=,ed2166483141b4f3d59ee07975a5d91990e4c17f36c919565b8063c0cb02f7ed
+github.com/valyala/fasttemplate,v1.0.1,h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8=,b4d9f77c6c15a0404952925ad59b759102c0ff48426b6fc88d6bfd347fe243b8
+github.com/valyala/tcplisten,v0.0.0-20161114210144-ceec8f93295a,h1:0R4NLDRDZX6JcmhJgXi5E4b8Wg84ihbmUKp/GvSPEzc=,07066d5b879a94d6bc1feed20ad4003c62865975dd1f4c062673178be406206a
+github.com/vbatts/tar-split,v0.11.1,h1:0Odu65rhcZ3JZaPHxl7tCI3V/C/Q9Zf82UFravl02dE=,73136db95ff35c2547c49be43727aa3f67da2d8837e1475954db910b41b1fa18
+github.com/veandco/go-sdl2,v0.3.3,h1:4/TirgB2MQ7oww3pM3Yfgf1YbChMlAQAmiCPe5koK0I=,d19e162daa2a6cc72569eb052adfd3d757fd069ee461a64803e9e8f2e9bb87a7
+github.com/vektah/dataloaden,v0.2.1-0.20190515034641-a19b9a6e7c9e,h1:+w0Zm/9gaWpEAyDlU1eKOuk5twTjAjuevXqcJJw8hrg=,92fe72fa4962bb2f375fae83f7a44a804e398ec08818f7d018724e0a23394ae3
+github.com/vektah/gqlparser,v1.1.2,h1:ZsyLGn7/7jDNI+y4SEhI4yAxRChlv15pUHMjijT+e68=,cdd0119855b98641e7af60dce5b2848b31f8ef03dfcf097c06912309b86fc97c
+github.com/viant/assertly,v0.4.8,h1:5x1GzBaRteIwTr5RAGFVG14uNeRFxVNbXPWrK2qAgpc=,253a5e53bb09bf94be7131d5034a6ba19c6eb1f9b8c7fa66182d577bd7b2d6cd
+github.com/viant/toolbox,v0.24.0,h1:6TteTDQ68CjgcCe8wH3D3ZhUQQOJXMTbj/D9rkk2a1k=,d6773a06b59de043eff2003bb97567056a1910eb0fd514f5503873b8f23309f4
+github.com/vimeo/go-util,v1.2.0,h1:YHzwOnM+V2tc6r67K9fXpYqUiRwXp0TgFKuyj+A5bsg=,85e52371bcf8299d47d8242546bc06e9e0c9c555b719008096889cd081a69173
+github.com/vincent-petithory/dataurl,v0.0.0-20160330182126-9a301d65acbb,h1:lyL3z7vYwTWXf4/bI+A01+cCSnfhKIBhy+SQ46Z/ml8=,5d5fa46ce0f88ba0734f52d0b0bcaa8a427770ef13cd1bfd7995e4d2a8439abb
+github.com/vishvananda/netlink,v1.0.0,h1:bqNY2lgheFIu1meHUFSH3d7vG93AFyqg3oGbJCOJgSM=,6fb7184280eb1321e1857171862bdb624eae29876496f1cb56932fbc0064020f
+github.com/vishvananda/netns,v0.0.0-20190625233234-7109fa855b0f,h1:nBX3nTcmxEtHSERBJaIo1Qa26VwRaopnZmfDQUXsF4I=,a99a67e03a35e1d02d1a17900185a1c38c513a79b2b325ad826553dc078a90de
+github.com/vivint/infectious,v0.0.0-20190108171102-2455b059135b,h1:dLkqBELopfQNhe8S9ucnSf+HhiUCgK/hPIjVG0f9GlY=,f5d948bf34ac58786ad20df4fd6e99f990f72458dd2825558bf2e3c871f3f37a
+github.com/vmihailenco/msgpack,v4.0.4+incompatible,h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=,918f7dd7883105b9c55728c704a3bc54c80568b2b09583890b51508c03391356
+github.com/vmware/govmomi,v0.21.0,h1:jc8uMuxpcV2xMAA/cnEDlnsIjvqcMra5Y8onh/U3VuY=,75ca40f34da851e95d7e63685adbaf1ec5c7f659fb0b47096c85da44f098c4a3
+github.com/vmware/vic,v1.5.4,h1:y546pkye0aes2j2h2n6fWz++v8WxMZTLFl1mLOMzqYQ=,2a6f0c20be8acb3b467c78d3de18009ccd0ab2429a997266089d14341e43115c
+github.com/vmware/vmw-guestinfo,v0.0.0-20170707015358-25eff159a728,h1:sH9mEk+flyDxiUa5BuPiuhDETMbzrt9A20I2wktMvRQ=,29c73ba44ac315461640797d6ebfda2d906c28dbe21c20656c6e5fa1f515f220
+github.com/vulcand/oxy,v1.0.0,h1:7vL5/pjDFzHGbtBEhmlHITUi6KLH4xXTDF33/wrdRKw=,148843b55ed01813f8920aab70a799aa10cfdccc0bbd55e270cde78e1ad23b88
+github.com/vulcand/predicate,v1.1.0,h1:Gq/uWopa4rx/tnZu2opOSBqHK63Yqlou/SzrbwdJiNg=,3dd716f2436651429ce7f5fdd59fa1a9944ab4d57fdbae5fef00ef01baf7c4be
+github.com/vultr/govultr,v0.1.4,h1:UnNMixYFVO0p80itc8PcweoVENyo1PasfvwKhoasR9U=,7281fa718c076b84610b155fb0dec34503ea1ae5f2930cc714ed7772e475bb08
+github.com/warpfork/go-wish,v0.0.0-20190328234359-8b3e70f8e830,h1:8kxMKmKzXXL4Ru1nyhvdms/JjWt+3YLpvRb/bAjO/y0=,77a9eefa3edf38cb90eba443f282bd73ffcb6f1b87aebe8f891d8c8b38124d95
+github.com/weaveworks/common,v0.0.0-20190917143411-a2b2a6303c33,h1:UAh7j96ZXQID3shhQsrtfJsrQ2uO3tyRxCuXvh+kipw=,e1ceacd5b24c6414ae664f4b09e295dc25e48d3a1dcd5100d8c98dd405a0d162
+github.com/weaveworks/mesh,v0.0.0-20191031093817-8e3db2fe8f47,h1:RUdrWPah1Xu+efIGqN0YGTv7gQeyR5qwBq9uL4HloKw=,05f5d769f7ff6af1c098f0e42983227d6a86f5d8d1f8453cb0566450cad49358
+github.com/wellington/go-libsass,v0.9.3-0.20181113175235-c63644206701,h1:9vG9vvVNVupO4Y7uwFkRgIMNe9rdaJMCINDe8vhAhLo=,2ae95ed360950fab28eff3bedf1c1a6f5f81b73078000d3a0bd67443d38df87f
+github.com/wendal/errors,v0.0.0-20130201093226-f66c77a7882b,h1:0Ve0/CCjiAiyKddUMUn3RwIGlq2iTW4GuVzyoKBYO/8=,f7722558c5c450fa02e800ce7bf4d0bc1d2a0e1696d3fc50ff1489bcd02ff3b3
+github.com/weppos/publicsuffix-go,v0.5.0,h1:rutRtjBJViU/YjcI5d80t4JAVvDltS6bciJg2K1HrLU=,bd8365c8501b307a1fbd62501bc3332ff97721bef51921a99e67a3f8b96318fc
+github.com/whyrusleeping/cbor-gen,v0.0.0-20190910031516-c1cbffdb01bb,h1:8yBVx6dgk1GfkiWOQ+RbeDDBLCOZxOtmZ949O2uj5H4=,9d5ab8362eaffa07bc2700d9a9e967c1ecf394e3233a6e7141efb48970bfd4e5
+github.com/whyrusleeping/chunker,v0.0.0-20181014151217-fe64bd25879f,h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E=,b28fdb03b69be216c423967e9dee2481aa10c3e39c71d3bfc8911940dadb26a9
+github.com/whyrusleeping/go-keyspace,v0.0.0-20160322163242-5b898ac5add1,h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k=,9416f8227e6c516294b9b938fcf2347bebe2cdab4377454150ba60dcd86c2990
+github.com/whyrusleeping/go-logging,v0.0.0-20170515211332-0457bb6b88fc,h1:9lDbC6Rz4bwmou+oE6Dt4Cb2BGMur5eR/GYptkKUVHo=,125b1a836936436354791583be42ae19f7c04a636b5c0c96135645d52aaa72ea
+github.com/whyrusleeping/go-notifier,v0.0.0-20170827234753-097c5d47330f,h1:M/lL30eFZTKnomXY6huvM6G0+gVquFNf6mxghaWlFUg=,08dddb594554c3b35791893207e66dd3c04e4da24d0e0df001bb185f97dec6cc
+github.com/whyrusleeping/go-smux-multiplex,v3.0.16+incompatible,h1:iqksILj8STw03EJQe7Laj4ubnw+ojOyik18cd5vPL1o=,e16e3da58e283e71955b21725c384d180a2999bc2a50cb0490b5e2f7a74b5fc6
+github.com/whyrusleeping/go-smux-multistream,v2.0.2+incompatible,h1:BdYHctE9HJZLquG9tpTdwWcbG4FaX6tVKPGjCGgiVxo=,9a783c4a1b69f6002ac4e0af684f4d5c4d360b7107fbbdde48faf38f7e23e998
+github.com/whyrusleeping/go-smux-yamux,v2.0.9+incompatible,h1:nVkExQ7pYlN9e45LcqTCOiDD0904fjtm0flnHZGbXkw=,3f44f41fc7b133085bba08d52e7615e9a8eb92f55fde6a07d3cd7804117e9985
+github.com/whyrusleeping/mafmt,v1.2.8,h1:TCghSl5kkwEE0j+sU/gudyhVMRlpBin8fMBBHg59EbA=,e5d5783d2bc35f7c23f2034fd52c5750ad0590773115c10b4e15360575322c69
+github.com/whyrusleeping/mdns,v0.0.0-20180901202407-ef14215e6b30,h1:nMCC9Pwz1pxfC1Y6mYncdk+kq8d5aLx0Q+/gyZGE44M=,fc2e4d2365ba40d52d03126ea490e712762b4ad398c8d6adb2a1a08699a10eb1
+github.com/whyrusleeping/multiaddr-filter,v0.0.0-20160516205228-e903e4adabd7,h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds=,14e8963464dab0f6277f596985be5ea419bc3bae8bf4f4f139cce456e1815faf
+github.com/whyrusleeping/timecache,v0.0.0-20160911033111-cfcb2f1abfee,h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow=,c33dfc5ac935582261bf5ddbab31bb07febc471a9c26eb3e1a895eddd574d3e8
+github.com/whyrusleeping/yamux,v1.1.5,h1:4CK3aUUJQu0qpKZv5gEWJjNOQtdbdDhVVS6PJ+HimdE=,658f9e704cbe1cac295ed34471bb096a4d2713f69ffbb8140fbf50b8ff6420e0
+github.com/willf/bitset,v1.1.9,h1:GBtFynGY9ZWZmEC9sWuu41/7VBXPFCOAbCbqTflOg9c=,ddd687772ccfd6774e55e7e9d9e71dab86d85a64b98ce1d864d9661f5b0767e4
+github.com/x-cray/logrus-prefixed-formatter,v0.5.2,h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg=,00719eeb4f9eadb9431dd9f763fa4013dc52b37a8803a973c6d0c1ce8281e14b
+github.com/xanzy/go-cloudstack,v0.0.0-20190526095453-42f262b63ed0,h1:NJrcIkdzq0C3I8ypAZwFE9RHtGbfp+mJvqIcoFATZuk=,34b46eae351e4916015ce2a43ed501403937e4079cf69dae98a9544bfeec8092
+github.com/xanzy/go-gitlab,v0.21.0,h1:Ru55sR4TBoDNsAKwCOpzeaGtbiWj7xTksVmzBJbLu6c=,12ae6fa35c19fffc31d1fa2891f386875caac8077d19f3f09f49b5e2e51b1755
+github.com/xanzy/ssh-agent,v0.2.1,h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70=,7011c1771f8ad9b65795f8a85113e4518c9a2c7493029c4c988bc802b63d9e28
+github.com/xdg/scram,v0.0.0-20180814205039-7eeb5667e42c,h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk=,33884d438b686676ceaa2a439634a108f7fe763ce974342d2aa811c22b34112c
+github.com/xdg/stringprep,v1.0.0,h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0=,2b262e4e8e9655100c98e2b7e75b517e3e83e2155818174c63ea09d3cce22721
+github.com/xeipuuv/gojsonpointer,v0.0.0-20180127040702-4e3ac2762d5f,h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=,5b1a4bcc8e003f214c92b3fa52959d9eb0e3af1c0c529efa55815db951146e48
+github.com/xeipuuv/gojsonreference,v0.0.0-20180127040603-bd5ef7bd5415,h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=,7ec98f4df894413f4dc58c8df330ca8b24ff425b05a8e1074c3028c99f7e45e7
+github.com/xeipuuv/gojsonschema,v1.2.0,h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=,55c8ce068257aa0d263aad7470113dafcd50f955ee754fc853c2fdcd31ad096f
+github.com/xenolf/lego,v2.7.2+incompatible,h1:aGxxYqhnQLQ71HsvEAjJVw6ao14APwPpRk0mpFroPXk=,25c2495e4fc2f5fea8c70b442add86c049f2f8810235e1ee94f29d8e0267ad2c
+github.com/xeonx/timeago,v1.0.0-rc4,h1:9rRzv48GlJC0vm+iBpLcWAr8YbETyN9Vij+7h2ammz4=,b06f4ede554b35387394827ca0350b628a72228a8002653817826991867e1fdd
+github.com/xi2/xz,v0.0.0-20171230120015-48954b6210f8,h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo=,1ffe8f24af5118966084d41eca2c9bee7a831a07deb4356e4d707d208da22e8e
+github.com/xiang90/probing,v0.0.0-20190116061207-43a291ad63a2,h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=,437bdc666239fda4581b592b068001f08269c68c70699a721bff9334412d4181
+github.com/xlab/treeprint,v0.0.0-20181112141820-a009c3971eca,h1:1CFlNzQhALwjS9mBAUkycX616GzgsuYUOCHA5+HSlXI=,d14ebea967caa835f25e4c3980c60719e07f0e36375b74dc48928613fca5b2ff
+github.com/xo/dburl,v0.0.0-20191005012637-293c3298d6c0,h1:6DtWz8hNS4qbq0OCRPhdBMG9E2qKTSDKlwnP3dmZvuA=,1fb150cf2144a4b7a571360af52d9b22dfe53e2ba9ab3e56584fdb0eb282d315
+github.com/xordataexchange/crypt,v0.0.3-0.20170626215501-b2862e3d0a77,h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow=,46dc29ef77d77a2bc3e7bd70c94dbaeec0062dd3bd6fcacbaab785c15dcd625b
+github.com/xtaci/kcp-go,v5.4.5+incompatible,h1:CdPonwNu3RKu7HcXSno5r0GXfTViDY2iFV2RDOao/4U=,98e77493d94b33bfec990bd5791d15a09add1a0ba2f3281f26bdc98c1815d9a7
+github.com/xtaci/lossyconn,v0.0.0-20190602105132-8df528c0c9ae,h1:J0GxkO96kL4WF+AIT3M4mfUVinOCPgf2uUWYFUzN0sM=,75cc8c3e14cf812dcc56a1e8cecafd8affd9b2843d39540ab67929f7ce3d1abc
+github.com/xtgo/set,v1.0.0,h1:6BCNBRv3ORNDQ7fyoJXRv+tstJz3m1JVFQErfeZz2pY=,6b70026a5ea66bc0be7efb2247afa53ae970b9535c7a8541795750ef9b640217
+github.com/yalp/jsonpath,v0.0.0-20150812003900-31a79c7593bb,h1:06WAhQa+mYv7BiOk13B/ywyTlkoE/S7uu6TBKU6FHnE=,d2041be5f19a3dbcd4b384dbbf5782cdb96d80ad9c60c8c9b887f2c5170cb25f
+github.com/yandex-cloud/go-genproto,v0.0.0-20190928220815-a36c849d0fc1,h1:GDyRNvsi/tOZj1ssPkk+kocO1djpbmLSpDKg4XeRPy4=,5502c680146902518514935af5ab5b554a80f5ebe2e79d491db3120911f5498d
+github.com/yandex-cloud/go-sdk,v0.0.0-20190916101744-c781afa45829,h1:2FGwbx03GpP1Ulzg/L46tSoKh9t4yg8BhMKQl/Ff1x8=,4b375b871ce7501943a26ba02c348ad4fdf2cb112520513628566a15a98a4796
+github.com/yohcop/openid-go,v0.0.0-20160914080427-2c050d2dae53,h1:HsIQ6yAjfjQ3IxPGrTusxp6Qxn92gNVq2x5CbvQvx3w=,8c4f676193e3aa5ec012e0661d0e552a3e5d5d96086a73901dcfbf0bd4a6d2e9
+github.com/yookoala/realpath,v1.0.0,h1:7OA9pj4FZd+oZDsyvXWQvjn5oBdcHRTV44PpdMSuImQ=,9fe8b06f8efabb7df08608f18edc77d284e04ad06d490af9f55196e4184c339f
+github.com/yosssi/ace,v0.0.5,h1:tUkIP/BLdKqrlrPwcmH0shwEEhTRHoGnc1wFIWmaBUA=,96157dbef72f2f69a900e09b3e58093ee24f7df341ac287bddfb15f8c3f530db
+github.com/yosssi/gmq,v0.0.1,h1:GhlDVaAQoi3Mvjul/qJXXGfL4JBeE0GQwbWp3eIsja8=,d06bbe96ba0e8c3c79bfb0b9191a02a19d8d3d3c181eba62df6d94c0602c784e
+github.com/youtube/vitess,v2.1.1+incompatible,h1:SE+P7DNX/jw5RHFs5CHRhZQjq402EJFCD33JhzQMdDw=,2eb3c516c8b24a72b8cb14f76f39562638acf0cd7fc3858002163d28047607f2
+github.com/yudai/gojsondiff,v0.0.0-20170107030110-7b1b7adf999d,h1:yJIizrfO599ot2kQ6Af1enICnwBD3XoxgX3MrMwot2M=,3f61230fe62a6fe2e93a75264d176bda3f62323063c1e9bfb87c0be31ac5d269
+github.com/yudai/golcs,v0.0.0-20150405163532-d1c525dea8ce,h1:888GrqRxabUce7lj4OaoShPxodm3kXOMpSa85wdYzfY=,ff1f3899e710574a08aaa51051a36c523ecf850180ad0564d55eec611c3cff72
+github.com/yudai/pp,v2.0.1+incompatible,h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI=,ecfda4152182e295f2b21a7b2726e2865a9415fc135a955ce42e039db29e7a20
+github.com/yuin/gopher-lua,v0.0.0-20190514113301-1cd887cd7036,h1:1b6PAtenNyhsmo/NKXVe34h7JEZKva1YB/ne7K7mqKM=,fd157d5d26c336c44837eceef5c6fc4b442a56b25931d4afae3c4080932a7aa7
+github.com/zach-klippenstein/goregen,v0.0.0-20160303162051-795b5e3961ea,h1:CyhwejzVGvZ3Q2PSbQ4NRRYn+ZWv5eS1vlaEusT+bAI=,6f523a11fcb80dca31c3bae99c8c4a59b7e5a4176e36cad0e3f1e64e1b9a7b11
+github.com/zclconf/go-cty,v1.1.0,h1:uJwc9HiBOCpoKIObTQaLR+tsEXx1HBHnOsOOpcdhZgw=,024660decfe11e74a9fab80f1447b79c61e328baf6418629a15c74e183b95e95
+github.com/zclconf/go-cty-yaml,v1.0.1,h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8=,2502da37ac6d9105b07748c4252f970aa6a7ffc8929b92a0b85abb81b804e9b7
+github.com/zeebo/admission,v0.0.0-20180821192747-f24f2a94a40c,h1:WoYvMZp+keiJz+ZogLAhwsUZvWe81W+mCnpfdgEUOl4=,b62a80509cfa84e697b23dd6b1b314a264e6f68586661ecd84026625f7753cb1
+github.com/zeebo/assert,v1.0.0,h1:qw3LXzO7lbptWIQ6DsemJIUOoaqyKbgY3M8b8yvlaaY=,bb31d428cc59a322975ab6b5757832e62507655f3e2c467a88345b21d7431d98
+github.com/zeebo/errs,v1.2.2,h1:5NFypMTuSdoySVTqlNs1dEoU21QVamMQJxW/Fii5O7g=,d2fa293e275c21bfb413e2968d79036931a55f503d8b62381563ed189b523cd2
+github.com/zeebo/float16,v0.1.0,h1:kRqxv5og6z1emEyz5FpW0/BVHe5VfxEAw6b1ljCZlUc=,ffc6b2a7bce5e37798bc3ac53448b6190039a77f2e7d589779680fbd3cb53a48
+github.com/zeebo/incenc,v0.0.0-20180505221441-0d92902eec54,h1:+cwNE5KJ3pika4HuzmDHkDlK5myo0G9Sv+eO7WWxnUQ=,141b997c5ece8f136f43644f5a2526305563128c4ecce280d9a54ce1ae506ba2
+github.com/zeebo/structs,v1.0.2,h1:kvcd7s2LqXuO9cdV5LqrGHCOAfCBXaZpKCA3jD9SJIc=,0495c69abfeb2ffa0911f4c44ba145d81b04ec76d2311e2eedfc2b3e2efd66c9
+github.com/zenazn/goji,v0.9.0,h1:RSQQAbXGArQ0dIDEq+PI6WqN6if+5KHu6x2Cx/GXLTQ=,0807a255d9d715d18427a6eedd8e4f5a22670b09e5f45fddd229c1ae38da25a9
+github.com/ziutek/mymysql,v1.5.4,h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=,1ea104186e0990a3d97a1e67fcd31177849c975de4abd9399270ab0a04c025de
+github.com/zkfy/cron,v0.0.0-20170309132418-df38d32658d8,h1:jxPemXnLeekMXItoaw4jZtDfe8HmvFmviUm2L5tEBhE=,81a903448f6bc140e07bc4ff70762f0a46e750388f4b92f700d358331b1ca8d5
+github.com/zkfy/go-metrics,v0.0.0-20161128210544-1f30fe9094a5,h1:Rb2qQMbEon+BI3IXGh4eW3u/iTLPA3+Y6kNK+gHO32w=,07f9078cbc233559128dc4ae80d69505dd1a07d47d33135fc8f4969829fd6ee8
+github.com/zkfy/jwt-go,v3.0.0+incompatible,h1:5hZNIkrRRa0mrkRiXoPFdLJWpMDByIZ6VIbX9aWhwmk=,8306a4a65059e17be035dd47f45d83aac503c50c954716c83e481d0b6530aed6
+github.com/zkfy/log,v0.0.0-20180312054228-b2704c3ef896,h1:nktyhX5ycnu+WA489Ei7SUi00bF+LW8TF2N7se5gQ/o=,dd0acb5ccceb2225c89f0f50dc8eea9f1cae0971b731750ea7a1b186c194d9bc
+github.com/zkfy/stompngo,v0.0.0-20170803022748-9378e70ca481,h1:dqbWcJVZJv06ZR7zK8yN9w8oNOHL23eylL4o9Xj9Zn0=,9e643fbfd166421cb186275742bafc663fc350da83e59e9d88c06feb12ec4462
+github.com/zmap/rc2,v0.0.0-20131011165748-24b9757f5521,h1:kKCF7VX/wTmdg2ZjEaqlq99Bjsoiz7vH6sFniF/vI4M=,fd70713ed40c95220e95c7c47f7e15051e8dc909d39253f403bb694f45fbe789
+github.com/zmap/zcertificate,v0.0.0-20180516150559-0e3d58b1bac4,h1:17HHAgFKlLcZsDOjBOUrd5hDihb1ggf+1a5dTbkgkIY=,7dc2c0bedccfdeb9c42ef41ef502f404befa9ef073c35db3b15c99cae6697b41
+github.com/zmap/zcrypto,v0.0.0-20190729165852-9051775e6a2e,h1:mvOa4+/DXStR4ZXOks/UsjeFdn5O5JpLUtzqk9U8xXw=,871979cf16453ddb4db7f153f449af4e346f68b51355c74b5eee832225618ff0
+github.com/zmap/zlint,v0.0.0-20190806154020-fd021b4cfbeb,h1:vxqkjztXSaPVDc8FQCdHTaejm2x747f6yPbnu1h2xkg=,e62f5cd5f434d84f53d336261e3a6e50c8902152ce8f2f5ce918270d6d201cab
+github.com/zondax/hid,v0.9.0,h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8=,9c72a6bdbf03d9465dfdf1ba876eabf5fa923d5bb9e726c9e4a994098dc9bd79
+github.com/zondax/ledger-go,v0.9.0,h1:oTrtFqPFA4VdCPRvqMaN45mQnJxkPc0JxoVZfCoUpjI=,6c6a7e036f9a621ce951939d7d13ae1f0c098f58829307c78f9312e02e78e438
+github.com/zquestz/grab,v0.0.0-20190224022517-abcee96e61b1,h1:1qKTeMTSIEvRIjvVYzgcRp0xVp0eoiRTTiHSncb5gD8=,4decd67f1252df4ee34968cb0cb4e7dc6010302b24ce8edd418f1c2520f1c351
+gitlab.com/NebulousLabs/errors,v0.0.0-20171229012116-7ead97ef90b8,h1:gZfMjx7Jr6N8b7iJO4eUjDsn6xJqoyXg8D+ogdoAfKY=,b355474f1a2ef2722ae450ef6df7209d223188ae413706be122b472fcc053c48
+gitlab.com/NebulousLabs/fastrand,v0.0.0-20181126182046-603482d69e40,h1:dizWJqTWjwyD8KGcMOwgrkqu1JIkofYgKkmDeNE7oAs=,a56acdda993c7a4795028fe38844d54de9b1877d22e8ae09f205e488ce2284bc
+gitlab.com/yumeko/MumbleEmu,v0.0.0-20170923112213-54c9892f02e9,h1:QSaGLacCEAlWXhL/xGZyS3+2aDVvBZe5jcmrDWwXhqs=,51cc295a04dc3b9c39b341f21b95fc42765e3bb61fe30ec2a59fe867c1b5e5ed
+go.bug.st/serial.v1,v0.0.0-20180827123349-5f7892a7bb45,h1:mACY1anK6HNCZtm/DK2Rf2ZPHggVqeB0+7rY9Gl6wyI=,f0ea4cd4c51228f1a3cf14c6b92888169944f267e1ee778909512a4c8ac4762f
+go.cryptoscope.co/luigi,v0.3.4,h1:eDrtCoUL5Vl2Atr5ty2dq0uFbzFCc6Pz1HEqU1e7I1I=,949612e92dcb2fc919e506740f36d0cfe0797c1f85579a98763aad0135a4580a
+go.dedis.ch/fixbuf,v1.0.3,h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs=,dfa737543a5873b14cdfd0eec675c63044b16d3dbe481b2289c758ae4186ae95
+go.dedis.ch/kyber/v3,v3.0.8,h1:qnHzOBaxEO3+ZYuZAfwPTOPzX+F6QMmWGo8YJvENh68=,d69db17bd37bf14c4e508eb84974c3df9a82b8cb30b55ddc3ac0ee2784abcbac
+go.dedis.ch/kyber/v4,v4.0.0-pre1,h1:1f5OPESkyxK6kPaCSV3J9BlpnoysIpbGLNujX9Ov8m4=,d082a41e2178f7e18c088e414e020928794245a9dae41d07da842ebb667a337e
+go.dedis.ch/onet/v3,v3.0.26,h1:wQhVGB+SCdG7B0tbo6ZeZINQKWkU4u9TNMkGBH16EEM=,a41978897a3371f2eaaab5c84c354c95b4fdbd7b8207afa7c79f32b85f857d5d
+go.elastic.co/apm,v1.5.0,h1:arba7i+CVc36Jptww3R1ttW+O10ydvnBtidyd85DLpg=,447a5954db3f7fc61575c83782be0b6d69e453f1e667b0534d3bf5336039238a
+go.elastic.co/apm/module/apmhttp,v1.5.0,h1:sxntP97oENyWWi+6GAwXUo05oEpkwbiarZLqrzLRA4o=,1e6bc42b2e3ab10165036afd95a8a4d910acadce451c0b4e7c998cbb5c06da73
+go.elastic.co/apm/module/apmot,v1.5.0,h1:rPyHRI6Ooqjwny67au6e2eIxLZshqd7bJfAUpdgOw/4=,235fb0c1d0e107ffb7c5056e49226152063ac87ebc657428ea410d5170804d2e
+go.elastic.co/fastjson,v1.0.0,h1:ooXV/ABvf+tBul26jcVViPT3sBir0PvXgibYB1IQQzg=,451e29b2854f9e09c58e3fe4c1b3a72d9b2ee293628ab4c4323e8192af015c6c
+go.etcd.io/bbolt,v1.3.3,h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=,1ea076dbe18dabe78909e1fb7ec2954fc2d58cd72e7730ad69b35248a30049fd
+go.etcd.io/etcd,v3.3.17+incompatible,h1:g8iRku1SID8QAW8cDlV0L/PkZlw63LSiYEHYHoE6j/s=,7bd292878f70e154a061ed6b85fc70502aa270fcf0072340cbde1a0cb35b0d2d
+go.mongodb.org/mongo-driver,v1.1.2,h1:jxcFYjlkl8xaERsgLo+RNquI0epW6zuy/ZRQs6jnrFA=,6b3141ced32d7a41ebd0539df957b76331fc3efdca22eae68da54d41aad23fed
+go.opencensus.io,v0.22.1,h1:8dP3SGL7MPB94crU3bEPplMPe83FI4EouesJUeFHv50=,b8d9a5fca5e714c4bf66f6497dd905992113cfd6aae948bb7fad5ce987a520ed
+go.starlark.net,v0.0.0-20191021185836-28350e608555,h1:FhmD1D59MmncMfRVTRa889iERZG3jdaKj/1FtOQB1G0=,add124cd355e714f076a385eb3f2ddcfb8ce0c7c8e6611e2e03acc427a4c32bf
+go.uber.org/atomic,v1.5.0,h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY=,7e32f8f75b2029aa53399c2cd6e581398ac4e971c17a763980377279ede95c77
+go.uber.org/automaxprocs,v1.2.0,h1:+RUihKM+nmYUoB9w0D0Ov5TJ2PpFO2FgenTxMJiZBZA=,4c7bf41eab5dd7781c69130aa37011427531dee231ffbdc3c9ed4267c06aa93c
+go.uber.org/multierr,v1.3.0,h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc=,29b25df332dea2dbfaaa308013fc6d3673ecd3d9ee09c666c69df504533d0714
+go.uber.org/ratelimit,v0.1.0,h1:U2AruXqeTb4Eh9sYQSTrMhH8Cb7M0Ian2ibBOnBcnAw=,78f82854809625c784088b9dec5dfb4810fbbd09c24891b8aaf2c2679212dfd8
+go.uber.org/thriftrw,v1.20.2,h1:0JlCE7dOyWHEQdfDm0MWIbgTn6vXkiMA6LNIe8FQXjw=,148b93f97a6ab865e2dbe0eb09b9f9504248808efc437e20efc1bf9b7896de9a
+go.uber.org/tools,v0.0.0-20190618225709-2cfd321de3ee,h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=,988dba9c5074080240d33d98e8ce511532f728698db7a9a4ac316c02c94030d6
+go.uber.org/zap,v1.12.0,h1:dySoUQPFBGj6xwjmBzageVL8jGi8uxc6bEmJQjA06bw=,d4b304046a3f9443e4abe217889b5b2a4ecef35d52f175bcacf2baff18646595
+go4.org,v0.0.0-20191010144846-132d2879e1e9,h1:zHLoVtbywceo2hE4Wqv8CmIufe7jDERQ2KJHZoSDfCU=,21811f50d48c55047df1d6bf68db778087afe9116f1f32faf79f8ca459d29d89
+gobot.io/x/gobot,v1.14.0,h1:IJv4A9f5/lUz4JQaS37UW8bRVl3lG+jCGUcNmJ2F0vE=,95ad64d1bf33ee46816b2c87edb10d7b3bfe118b6f7026bf4b5f762867d1e776
+gocloud.dev,v0.17.0,h1:UuDiCphYsiNhRNLtgHVL/eZheQeCt00hL3XjDfbt820=,0df8e26a2356735d596e8a3917ec4b69f61fb5e9f6f291b51f6145a51b646a9b
+gocv.io/x/gocv,v0.21.0,h1:dVjagrupZrfCRY0qPEaYWgoNMRpBel6GYDH4mvQOK8Y=,9e1a70258d72b873d9605a2939b38f9e560650472d70b97f5dd0fc2657eaf35f
+golang.org/x/arch,v0.0.0-20191101135251-a0d8588395bd,h1:e1iK2rWppIPlzzqtjXT/p6WR/+ritGZ8xkfL8uDZb0g=,daba41c9150ebf192ce54952d69ef12fe47c5c6250a33c01f0624befea35354e
+golang.org/x/build,v0.0.0-20191031202223-0706ea4fce0c,h1:jjNoDZTS0vmbqBhqD5MPXauZW+kcGyflfDDFBNCPSVI=,a675f674bcee677f1dc9a15ca4d84bb2e842c29d745b165ba3e5423c09367d29
+golang.org/x/crypto,v0.0.0-20191029031824-8986dd9e96cf,h1:fnPsqIDRbCSgumaMCRpoIoF2s4qxv0xSSS0BVZUE/ss=,0a303100f9afba8628988bef45404b23c2e0c6aa73b5ad4ac9259af14a0e53ae
+golang.org/x/exp,v0.0.0-20191030013958-a1ab85dbe136,h1:A1gGSx58LAGVHUUsOf7IiR0u8Xb6W51gRwfDBhkdcaw=,18ff05b39d29a3fd4c7f9071e7013264994ac18f7faa72f66b2f514fcdd141b0
+golang.org/x/image,v0.0.0-20191009234506-e7c1f5e7dbb8,h1:hVwzHzIUGRjiF7EcUjqNxk3NCfkPxbDKRdnNE1Rpg0U=,aebca4c096dac7c20d9024b73bd0b4a87a85f4c6b50aae7615dec504c5f478c8
+golang.org/x/lint,v0.0.0-20190930215403-16217165b5de,h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs=,91323fe1a77f13de722a0ce8efc5c5f2da4f26216d858acec64cb23c956fa163
+golang.org/x/mobile,v0.0.0-20191031020345-0945064e013a,h1:CrJ8+QyIm2tcw/zt9Rp/vGFsey+jndL1y5EnFwzgGOg=,5ee0c7eed83b64cc851d6ddb76346413d7c43213ea1241385b588c66e2169854
+golang.org/x/mod,v0.1.0,h1:sfUMP1Gu8qASkorDVjnMuvgJzwFbTZSeXFiGBYAVdl4=,e0d9b32f6f66103f777e8357b5b60f94a486330d46c6c8ea87789dab1a14cefa
+golang.org/x/net,v0.0.0-20191101175033-0deb6923b6d9,h1:DPz9iiH3YoKiKhX/ijjoZvT0VFwK2c6CWYWQ7Zyr8TU=,b07094a5589a436fd98c6700cd5898f2094d9c02f8385f9331a7ace46305c7ae
+golang.org/x/oauth2,v0.0.0-20190604053449-0f29369cfe45,h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=,f72b6c3c2b734ad053fadf5fa2adb2ad23024cfeacd567fec31a751526d1dfe0
+golang.org/x/perf,v0.0.0-20180704124530-6e6d33e29852,h1:xYq6+9AtI+xP3M4r0N1hCkHrInHDBohhquRgx9Kk6gI=,a2c7d02cc94c4ba767b6322f70ddcba4941cb5f60fed1bada3aa7a4d3a8128f1
+golang.org/x/sync,v0.0.0-20190911185100-cd5d95a43a6e,h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=,9c63fe51b0c533b258d3acc30d9319fe78679ce1a051109c9dea3105b93e2eef
+golang.org/x/sys,v0.0.0-20191029155521-f43be2a4598c,h1:S/FtSvpNLtFBgjTqcKsRpsa6aVsI6iztaz1bQd9BJwE=,c5a8efb84e706e4ec1e1fa5cda44d1d571e8b3f46afe165d5e93b90e777a15fc
+golang.org/x/text,v0.3.2,h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=,f755c0e7f4693f170e2f03c161f500b33f82accb8184a38dcfda63fed883f13c
+golang.org/x/time,v0.0.0-20191024005414-555d28b269f0,h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=,e0ca5eceb4840bcc264237408ff8942044e19b503d6e8e5546ed9f7e1f4bf82e
+golang.org/x/tools,v0.0.0-20191101200257-8dbcdeb83d3f,h1:+QO45yvqhfD79HVNFPAgvstYLFye8zA+rd0mHFsGV9s=,c3beb2acb726571e4cca3e922dd1eb037dcb6ef66ca562e9544716a53b6a1026
+golang.org/x/xerrors,v0.0.0-20191011141410-1b5146add898,h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=,5059c7b7e95f139b8c42d9001972fa5fa688b3581ef946c912c1dbc52415ff16
+gomodules.xyz/envconfig,v1.3.0,h1:w1laMNVtP05uOKqmRAY6Vx7HvfPL9yc388gcVtUiI/M=,ae5b4ee26eeb143c16bfb5316eb97e8ff4418bce379ae74e2a0bba367706d69c
+gomodules.xyz/jsonpatch/v2,v2.0.1,h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0=,3c97ac5b7cfa3388f3dc157e20e6ad7b7a5789a4df1d5257a39589cf66edd462
+gonum.org/v1/gonum,v0.6.0,h1:DJy6UzXbahnGUf1ujUNkh/NEtK14qMo2nvlBPs4U5yw=,98857b431471c87facf3cd779eadc5d33760c9edee4b56a8228af4b383b90aa2
+gonum.org/v1/netlib,v0.0.0-20190331212654-76723241ea4e,h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts=,ed4dca5026c9ab5410d23bbe21c089433ca58a19bd2902311c6a91791142a687
+gonum.org/v1/plot,v0.0.0-20191004082913-159cd04f920c,h1:Ssc2Jy4xun3/JMt2asledr/xSPAvX7ZZ7HimX2Gwz1w=,9246b6f7a9299061b31d99e50b2ac2685853dc478a6c2c730fada016c7268ea1
+google.golang.org/api,v0.13.0,h1:Q3Ui3V3/CVinFWFiW39Iw0kMuVrRzYX0wN6OPFp0lTA=,4c853034281c673829b7a7f3e39c62640d01895d20a666f003f855ad5f55ec30
+google.golang.org/appengine,v1.6.5,h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM=,24ddb4adf72189738dc8340b28f9493a385515e680eb0bfbffe08951412b6655
+google.golang.org/genproto,v0.0.0-20191028173616-919d9bdd9fe6,h1:UXl+Zk3jqqcbEVV7ace5lrt4YdA4tXiz3f/KbmD29Vo=,cb4eec9cf94aa450efbb0d131cf1484f6334f1e8c1e1475b76c3ab2dea76c72a
+google.golang.org/grpc,v1.24.0,h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s=,eb4433685a85e20f934c2a98e35d104db2d77abe438a242d75d5aae9f78898fb
+google.golang.org/protobuf,v0.0.0-20191101204728-ef19a2a99470,h1:wSgCzfaFwg6Q4Eh+T7XknFfgswhFaeYkEs8t5endA/c=,73a49a6e5fd3330de7364564ab0954146e25ad8bbdff0ea6180f8ace153b0c1b
+gopkg.in/Acconut/lockfile.v1,v1.1.0,h1:c5AMZOxgM1y+Zl8eSbaCENzVYp/LCaWosbQSXzb3FVI=,66e89c98908e2b9295de1a32cdd90f626a2468c256ce6182d6339e6659548e71
+gopkg.in/AlecAivazis/survey.v1,v1.8.7,h1:oBJqtgsyBLg9K5FK9twNUbcPnbCPoh+R9a+7nag3qJM=,c924df9f9d79f015cc619b1ecede52c92618c0ab8d020cd63e2c783f46b3907d
+gopkg.in/DataDog/dd-trace-go.v1,v1.19.0,h1:aFSFd6oDMdvPYiToGqTv7/ERA6QrPhGaXSuueRCaM88=,f8eb14519d62c80eea88fca1daa69b274a0b492aa8b775890424b48d362c32b3
+gopkg.in/Shopify/sarama.v1,v1.18.0,h1:f9aTXuIEFEjVvLG9p+kMSk01dMfFumHsySRk1okTdqU=,beeb8546c4202289f282529630bc3db4452dc5f7eb69c3d8546196470c7d8be3
+gopkg.in/VividCortex/ewma.v1,v1.1.1,h1:tWHEKkKq802K/JT9RiqGCBU5fW3raAPnJGTE9ostZvg=,fe7800182ce944f2b28834d6cf60c620de0cbba1d691d9442f3473baf2a3d50d
+gopkg.in/airbrake/gobrake.v2,v2.0.9,h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo=,2db903664908e5a9afafefba94821b9579bbf271e2929c1f0b7b1fdd23f7bbcf
+gopkg.in/alecthomas/gometalinter.v2,v2.0.12,h1:/xBWwtjmOmVxn8FXfIk9noV8m2E2Id9jFfUY/Mh9QAI=,7e6b56f4b985a08d11c1494f9dcc2b595676e787afe7a1caa9c522d41cab9487
+gopkg.in/alecthomas/kingpin.v2,v2.2.6,h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=,638080591aefe7d2642f2575b627d534c692606f02ea54ba89f42db112ba8839
+gopkg.in/alecthomas/kingpin.v3-unstable,v3.0.0-20180810215634-df19058c872c,h1:vTxShRUnK60yd8DZU+f95p1zSLj814+5CuEh7NjF2/Y=,0e35a5bb02770611e4c53c611529b95b96d0bc573f05d10bb43f7441abef2fde
+gopkg.in/alexcesaro/quotedprintable.v3,v3.0.0-20150716171945-2caba252f4dc,h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=,1a310c5e55038937be3e69765276449601ca582f681129f7d9d47e052846cafc
+gopkg.in/asn1-ber.v1,v1.0.0-20181015200546-f715ec2f112d,h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM=,fee158570ba9cbfc11156afbe9b9ab0833ab00d0f1a2a2af29a6325984a79903
+gopkg.in/bblfsh/sdk.v1,v1.17.0,h1:Ez/4P0S0Zaq30iZKfiTlhOtqMx6dfQHMTYpqKFvnv4A=,172521b9f2bdd4180751ed5122971c9c37a8c0bca2e0710bc255bc0e5ff8c106
+gopkg.in/bblfsh/sdk.v2,v2.16.4,h1:Ta/kBVRGXf8UOBYDw/ih8mw13/8NND+AdR0JiXBQrOw=,eb7a8a7d08bd80cd0673a6b9c90fa524bda9db24242bd6ef82fb414941c4ef0f
+gopkg.in/bsm/ratelimit.v1,v1.0.0-20160220154919-db14e161995a,h1:stTHdEoWg1pQ8riaP5ROrjS6zy6wewH/Q2iwnLCQUXY=,fea8af18591a0ac50d29c8db124d13a43da6bee7a624c411b7449a99ee87b489
+gopkg.in/bufio.v1,v1.0.0-20140618132640-567b2bfa514e,h1:wGA78yza6bu/mWcc4QfBuIEHEtc06xdiU0X8sY36yUU=,9d63fe986f79edba7fca9bcd3bee0c7dcff7787cd30b43b5f2ae8a59feae512c
+gopkg.in/check.v1,v1.0.0-20190902080502-41f04d3bba15,h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=,004537cb19dbe45954ec1605f331705f6685ccc267eddd4289c1eb27513ab817
+gopkg.in/cheggaaa/pb.v1,v1.0.28,h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk=,39725f9f37aac44dd55bdc9ade65a2d066953a090456298d34203257fc7e8ee9
+gopkg.in/cheggaaa/pb.v2,v2.0.7,h1:beaAg8eacCdMQS9Y7obFEtkY7gQl0uZ6Zayb3ry41VY=,a6ba73f81893f0eca8c0a60c238a705a12bae499a44fe6217a4471687766ef02
+gopkg.in/clog.v1,v1.2.0,h1:BHfwHRNQy497iBNsRBassPixSAxRbn2z5KVkdBFbwxc=,51eb8901943d1cec850b55556a9989e21488a9636ac692d6f7575db057804f3d
+gopkg.in/editorconfig/editorconfig-core-go.v1,v1.3.0,h1:oxOEwvhxLMpWpN+0pb2r9TWrM0DCFBHxbuIlS27tmFg=,b5371885f56b40c03da4fd05006c717fabdfb8ee9ea1ceef4cc5b7caeda35041
+gopkg.in/errgo.v1,v1.0.1,h1:oQFRXzZ7CkBGdm1XZm/EbQYaYNNEElNBOd09M6cqNso=,32f45f7cfacfc04ae9e7e8c9fc55a53812554799da7c2bd17b043068b5fd5171
+gopkg.in/errgo.v2,v2.1.0,h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8=,6b8954819a20ec52982a206fd3eb94629ff53c5790aa77534e6d8daf7de01bee
+gopkg.in/fatih/color.v1,v1.7.0,h1:bYGjb+HezBM6j/QmgBfgm1adxHpzzrss6bj4r9ROppk=,ed20c58de8c575144c2cc1c924121ee1a240e0621c77918231547b576d46d3ce
+gopkg.in/fatih/set.v0,v0.2.1,h1:Xvyyp7LXu34P0ROhCyfXkmQCAoOUKb1E2JS9I7SE5CY=,d743141e21d20f6d5ae8e784dd4644c0947948103b63404a878b0298f14a9e62
+gopkg.in/fsnotify.v1,v1.4.7,h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=,ce003d540f42b3c0a3dec385deb387b255b536b25ea4438baa65b89458b28f75
+gopkg.in/fsnotify/fsnotify.v1,v1.4.7,h1:XNNYLJHt73EyYiCZi6+xjupS9CpvmiDgjPTAjrBlQbo=,6f74f844c970ff3059d1639c8a850d9ba7029dd059b5d9a305f87bd307c05491
+gopkg.in/gavv/httpexpect.v1,v1.0.0-20170111145843-40724cf1e4a0,h1:r5ptJ1tBxVAeqw4CrYWhXIMr0SybY3CDHuIbCg5CFVw=,4fe4a5e78a26ac5b60fc16405d3a5918d83cd645d36bd9dc0d558824136930b6
+gopkg.in/gcfg.v1,v1.2.3,h1:m8OOJ4ccYHnx2f4gQwpno8nAX5OGOh7RLaaz0pj3Ogs=,06cdad29610507bafb35e2e73d64fd7aa6c5c2ce1e5feff30a622af5475bca3b
+gopkg.in/gemnasium/logrus-airbrake-hook.v2,v2.1.2,h1:OAj3g0cR6Dx/R07QgQe8wkA9RNjB2u4i700xBkIT4e0=,ce35c69d2a1f49d8672447bced4833c02cc7af036aa9df94d5a6a0f5d871cccd
+gopkg.in/go-playground/assert.v1,v1.2.1,h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=,11da2f608d82304df2384a2301e0155fe72e8414e1a17776f1966c3a4c403bc4
+gopkg.in/go-playground/validator.v8,v8.18.2,h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ=,fea7482c7122c2573d964b7d294a78f2162fa206ccd4b808d0c82f3d87b4d159
+gopkg.in/go-playground/validator.v9,v9.30.0,h1:Wk0Z37oBmKj9/n+tPyBHZmeL19LaCoK3Qq48VwYENss=,f4769db84ddc2db880bc190a5420762ef45f80ebbce678b622c4fa82b422b890
+gopkg.in/gobwas/glob.v0,v0.2.3,h1:uLMy+ys6BqRCutdUNyWLlmEnd7VULqh1nsxxV1kj0qQ=,3a5fe045be1ff9b47c5e21a9f97bdefaada31463f365503d6b176b76e18a0257
+gopkg.in/gographics/imagick.v3,v3.2.0,h1:eUwlkCw2fa20OGu47G39Im8c50S9n/CVkh8PwtOKExA=,99695d22cf7d5609887609cc9dc63ca1031b5a3238c26f6b779f32e39d572a01
+gopkg.in/gomail.v2,v2.0.0-20160411212932-81ebce5c23df,h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=,08b3372836aef3a403b0a01e6867a3a2252a07f65c28e0d33fe9c4b1b3ac517a
+gopkg.in/gorp.v1,v1.7.2,h1:j3DWlAyGVv8whO7AcIWznQ2Yj7yJkn34B8s63GViAAw=,eaad3325e8b5358d5d54a1ca8b1e6aa19d16968a1f11f3dc45671588d914ef25
+gopkg.in/guregu/null.v3,v3.4.0,h1:AOpMtZ85uElRhQjEDsFx21BkXqFPwA7uoJukd4KErIs=,b38d62a816c5905933396a02eb11e23cbe2c17f8837563cc10794274e5af7e6e
+gopkg.in/h2non/gentleman.v2,v2.0.3,h1:exsUPKJDFwNjJykboVj8+BKPWMNOxR/AmPL3f7Hutwo=,7a71dc2dd74e413832782e4478f85cc0617aed125e078e308b46207f34d6a500
+gopkg.in/h2non/gock.v1,v1.0.15,h1:SzLqcIlb/fDfg7UvukMpNcWsu7sI5tWwL+KCATZqks0=,c6a3d33e638b56ddd050c1dc6c1c6c8e9007c70cacfcc29e778fcf421f1fc029
+gopkg.in/httprequest.v1,v1.2.0,h1:YTGV1oXzaoKI6oPzQ0knoIPcrrVzeRG3amkoxoP7Xng=,3960019870090d0de3fca818633111186d46a908b4bcac6d87e5f08e7fb58770
+gopkg.in/inconshreveable/log15.v2,v2.0.0-20180818164646-67afb5ed74ec,h1:RlWgLqCMMIYYEVcAR5MDsuHlVkaIPDAF+5Dehzg8L5A=,799307ed46ca30ca0ac2dc0332f3673814b8ff6cc1ee905a462ccfd438e8e695
+gopkg.in/inf.v0,v0.9.1,h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=,08abac18c95cc43b725d4925f63309398d618beab68b4669659b61255e5374a0
+gopkg.in/ini.v1,v1.49.0,h1:MW0aLMiezbm/Ray0gJJ+nQFE2uOC9EpK2p5zPN3NqpM=,579074067ceacbf11e938940d65647094da4f23f627645b5c58218bf05c060f0
+gopkg.in/jarcoal/httpmock.v1,v1.0.0-20181117152235-275e9df93516,h1:H6trpavCIuipdInWrab8l34Mf+GGVfphniHostMdMaQ=,5b896c9e5e44146260a066533409c1b86268458301a7155624ef27f784e5d94a
+gopkg.in/jcmturner/aescts.v1,v1.0.1,h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw=,8bfd83c7204032fb16946202d5d643bd9a7e618005bd39578f29030a7d51dcf9
+gopkg.in/jcmturner/dnsutils.v1,v1.0.1,h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM=,4fb8b6a5471cb6dda1d0aabd1e01e4d54cb5ee83c395849916392b19153f5203
+gopkg.in/jcmturner/goidentity.v3,v3.0.0,h1:1duIyWiTaYvVx3YX2CYtpJbUFd7/UuPYCfgXtQ3VTbI=,1be44bee93d9080ce89f40827c57e8a396b7c801e2d19a1f5446a4325afa755e
+gopkg.in/jcmturner/gokrb5.v7,v7.2.3,h1:hHMV/yKPwMnJhPuPx7pH2Uw/3Qyf+thJYlisUc44010=,3eec5b25adb89633174beb9798d8092e91ff4eed146a4b4cb950dd02414bd75e
+gopkg.in/jcmturner/rpc.v1,v1.1.0,h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU=,83d897b60ecb5a66d25232b775ed04c182ca8e02431f351b3768d4d2876d07ae
+gopkg.in/jmcvetta/napping.v3,v3.2.0,h1:NpSZLAL6VgiyhdqaOkxwVtHXOLrQJZ6fFOMQgp7G8PQ=,887358529a8cd287b6a8232b43cc48636463fa266bac5ba48328cb0609d1dcb6
+gopkg.in/juju/charm.v6,v6.0.0-20191031115626-f595bfd8a049,h1:+isWLR3tDZyDacru13gHH0ooIuuDB28kuZJjSc8kOqU=,8d404b146f31d35148015de3f5bd4d25260f0a4b9f22a540a9167864d9e5d082
+gopkg.in/juju/charmrepo.v3,v3.0.1,h1:mm7/CwCczsO7JYHlYkw4iCUYR7X8upEOaY5bYj7eUkw=,8f673109a6d98e4abe4ef612f85dea26bdbd7de5c66b6722c546a08aefb548fc
+gopkg.in/juju/environschema.v1,v1.0.0,h1:51vT1bzbP9fntQ0I9ECSlku2p19Szj/N2beZFeIH2kM=,46ae8efc5a450745fea959dc8532d2a013aa741ab7193d3cea8b0735f09c6e8a
+gopkg.in/juju/names.v2,v2.0.0-20190813004204-e057c73bd1be,h1:xDxN+Fe8olIH8sTqvFJBMsuflBYzeHVeYC4Iz97+f5M=,72ac554c125260751aadf6d41eb82d85de22ef8bff1d59c6602e9e0f5b84a28c
+gopkg.in/juju/worker.v1,v1.0.0-20191018043616-19a698a7150f,h1:UAHa7z4EdrOcMN+9p5P+ojJshcIC34vwi0hCmEL6Qf8=,2e0da8053029ca9da961f8e6f1037a9d7ba12623e5c16fc5f88bf1a724c5dd23
+gopkg.in/karalabe/cookiejar.v2,v2.0.0-20150724131613-8dcd6a7f4951,h1:DMTcQRFbEH62YPRWwOI647s2e5mHda3oBPMHfrLs2bw=,07aae15601f54a5806705d218e313794118d54d9dda7addc1bf4bda4332dfc16
+gopkg.in/kothar/go-backblaze.v0,v0.0.0-20190520213052-702d4e7eb465,h1:DKgyTtKkmpZZesLue2fz/LxEhzBDUWg4N8u/BVRJqlA=,215300ce3726c40f51ee43c41a27c204441e756c8cb4f4b76b1a4dd08f509eef
+gopkg.in/ldap.v2,v2.5.1,h1:wiu0okdNfjlBzg6UWvd1Hn8Y+Ux17/u/4nlk4CQr6tU=,4fd426691e674164a701ef3ec3548596574f95447cde1fa331018f7d73f8399b
+gopkg.in/ldap.v3,v3.0.2,h1:R6RBtabK6e1GO0eQKtkyOFbAHO73QesLzI2w2DZ6b9w=,f79d1cb87a0a6d571e671c2028409056d65e6bfa7d3d0563ded0edbe8ff0998e
+gopkg.in/macaron.v1,v1.3.4,h1:HvIscOwxhFhx3swWM/979wh2QMYyuXrNmrF9l+j3HZs=,f9aca15b099dada4382e47898516d500876aae45d36895314cde86700636c05c
+gopkg.in/macaroon-bakery.v2,v2.1.0,h1:9Jw/+9XHBSutkaeVpWhDx38IcSNLJwWUICkOK98DHls=,0a12f46df7290b131ee74ec6a4d4760170192920a091939aa2d7a39a4d0fb310
+gopkg.in/macaroon-bakery.v2-unstable,v2.0.0-20171026135619-38b77b89a624,h1:FIOL4YpoNbXH6K+LnOoAEMa/1ebliK7B9mj5NuJHmiA=,51476e40e03bd1f64fd3cdf936d1cde4b8c1395884af9376ff65755041c247aa
+gopkg.in/macaroon.v2,v2.1.0,h1:HZcsjBCzq9t0eBPMKqTN/uSN6JOm78ZJ2INbqcBQOUI=,ae47a93d20ce5c053eafc9d6a76c01b2b06784f9886137dc73a99302928046eb
+gopkg.in/macaroon.v2-unstable,v2.0.0-20180319203259-5c9beabe0e9e,h1:yPxshueS06kvTVlsymSbHvk6VQ1WhX1Ou3hCqqWBp/s=,e09a1f8268d65e3dc28da85c75e78f15f1f742d1dcd31cce427fd885b1962bc4
+gopkg.in/mail.v2,v2.0.0-20180731213649-a0242b2233b4,h1:a3llQg4+Czqaf+QH4diHuHiKv4j1abMwuRXwaRNHTPU=,d7d60701b95fd7f62d3f83bc026f42c0fa69c3f16cc445d2b20497c9dd182ff6
+gopkg.in/mattes/migrate.v1,v1.3.2,h1:tWus4MPMhDY/htX+NCvASiQVRU2pj4Jyj4T8AIv6vUw=,c50f590108871c25d55631addd6bc267f311830d4306ff4d36a6feaad0b23255
+gopkg.in/mattn/go-colorable.v0,v0.1.0,h1:WYuADWvfvYC07fm8ygYB3LMcsc5CunpxfMGKawHkAos=,337a25f7f87a87097e5fb853313c1fac3d3126ed0eb9bb88511d52ba9a0eb4e0
+gopkg.in/mattn/go-isatty.v0,v0.0.4,h1:NtS1rQGQr4IaFWBGz4Cz4BhB///gyys4gDVtKA7hIsc=,18500935e08e5b74487537b8b78a30778a5b2304a138f53aa8758b86266773ff
+gopkg.in/mattn/go-runewidth.v0,v0.0.4,h1:r0P71TnzQDlNIcizCqvPSSANoFa3WVGtcNJf3TWurcY=,e0307a435e39658f761b7526dda9149e7664b7250958494c1a4eebd14884b82d
+gopkg.in/mcuadros/go-syslog.v2,v2.2.1,h1:60g8zx1BijSVSgLTzLCW9UC4/+i1Ih9jJ1DR5Tgp9vE=,1f444e24504b6a21c0d204441a84336ab1240f77a1280b60e48f68ea1b99da7b
+gopkg.in/mgo.v2,v2.0.0-20190816093944-a6b53ec6cb22,h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw=,14edbec0d97107b0e0980b66166400f8a4c3844b03bd3240fc57be2b82734b16
+gopkg.in/natefinch/lumberjack.v2,v2.0.0,h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=,8c268e36660d6ce36af808d74b9be80207c05463679703e93d857e954c637aaa
+gopkg.in/neurosnap/sentences.v1,v1.0.6,h1:v7ElyP020iEZQONyLld3fHILHWOPs+ntzuQTNPkul8E=,e3df38d6fc6097f9d1d76ee13e24fec69103c43248ca6a7f3ade2afec5e85bdd
+gopkg.in/ns1/ns1-go.v2,v2.0.0-20190730140822-b51389932cbc,h1:GAcf+t0o8gdJAdSFYdE9wChu4bIyguMVqz0RHiFL5VY=,c51d0889ff5eb72df2f9e4adc28e9f3602e6eb567c3824bebb3c7d315a60710a
+gopkg.in/olivere/elastic.v2,v2.0.61,h1:7cpl3MW8ysa4GYFBXklpo5mspe4NK0rpZTdyZ+QcD4U=,0a20d84f6003850343937ef79179cabe99feef9b038c281fd65ec32ec6c7e85c
+gopkg.in/olivere/elastic.v5,v5.0.82,h1:QH7ere4lvOAWnnOd0VLJ54W8LzExZszoGIRijnb1h2Y=,3c66a7606b226d19f61651b3ad58aecda3155edc802029bd21cd4b8724bd0c9f
+gopkg.in/ory-am/dockertest.v3,v3.3.4,h1:oen8RiwxVNxtQ1pRoV4e4jqh6UjNsOuIZ1NXns6jdcw=,73b01a1d025d30c8f11def182179b873410eae72f7b2fd9f9394b0fcf4683c93
+gopkg.in/redis.v2,v2.3.2,h1:GPVIIB/JnL1wvfULefy3qXmPu1nfNu2d0yA09FHgwfs=,abe2fa39afa36f8186ee287bcf82f9f4bc083aa35d17dd82a2ccbf5850ecdde8
+gopkg.in/redis.v3,v3.6.4,h1:u7XgPH1rWwsdZnR+azldXC6x9qDU2luydOIeU/l52fE=,749ef3e08eb4eda43969f88135040ae4517b450b27dbd48aefb9bf5e72465621
+gopkg.in/redis.v4,v4.2.4,h1:y3XbwQAiHwgNLUng56mgWYK39vsPqo8sT84XTEcxjr0=,6403d2b45edf2804bfd07b6d697184fc97377168589ad43ad19b2433e1dcee34
+gopkg.in/redis.v5,v5.2.9,h1:MNZYOLPomQzZMfpN3ZtD1uyJ2IDonTTlxYiV/pEApiw=,3c30e42670d1ef5f0b33876928b3bd5693ef3b5be1df6b2710d48c2667ca7133
+gopkg.in/resty.v1,v1.12.0,h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI=,43487bb0bb40626d16502b1fe9e719cf751e7a5b4e4233276971873e7863d3cf
+gopkg.in/robfig/cron.v2,v2.0.0-20150107220207-be2e0b0deed5,h1:E846t8CnR+lv5nE+VuiKTDG/v1U2stad0QzddfJC7kY=,b25da9b8747e664334044e581d1a8fb700237239e7f182fd226d6296e6180bc0
+gopkg.in/satori/go.uuid.v1,v1.2.0,h1:AH9uksa7bGe9rluapecRKBCpZvxaBEyu0RepitcD0Hw=,794cefc3062e09b17f4300eb6b02622ac348af9d368341ff71a655a15884547f
+gopkg.in/sourcemap.v1,v1.0.5,h1:inv58fC9f9J3TK2Y2R1NPntXEn3/wjWHkonhIUODNTI=,05b5f382bfa60212f444c7207168e9eb0c722e26b57a688123cb8bbf234de692
+gopkg.in/spacemonkeygo/monkit.v2,v2.0.0-20190623001553-09813957f0a8,h1:nyw4hxw2zz4S0EHqr5nQfA3zGbMFJDRJlQPM4PCb7O4=,4a8e607c4f16b32bb9ee380627716979b19ac3df74ca2a4f80aefbaf0b411784
+gopkg.in/square/go-jose.v2,v2.4.0,h1:0kXPskUMGAXXWJlP05ktEMOV0vmzFQUWw6d+aZJQU8A=,d00c4af5a633ab9cf7645b68f6fa389c8f0d9ffebc486742c7a5292280cae84b
+gopkg.in/src-d/go-billy.v4,v4.3.2,h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg=,c49871e1d08bba07b2261626b929096b6dc5c839e781adfc24fcc410067cc2bf
+gopkg.in/src-d/go-cli.v0,v0.0.0-20181105080154-d492247bbc0d,h1:mXa4inJUuWOoA4uEROxtJ3VMELMlVkIxIfcR0HBekAM=,86042ffc0c8492845917453682c5bdba46beb2f0c067b61e495a92b9a8621076
+gopkg.in/src-d/go-errors.v1,v1.0.0,h1:cooGdZnCjYbeS1zb1s6pVAAimTdKceRrpn7aKOnNIfc=,f7d9f00c057d4b49bc6e57167561a7fb508ebb113a1946cb2b6f71dac5b14cfb
+gopkg.in/src-d/go-git-fixtures.v3,v3.5.0,h1:ivZFOIltbce2Mo8IjzUHAFoq/IylO9WHhNOAJK+LsJg=,282dc6474c5ecf62c1169d04ad1f6d75e6058922897b4709a16a1007a5f22eb7
+gopkg.in/src-d/go-git.v4,v4.13.1,h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE=,13364fe60f2316a179e912fb4eb6c576e2aabd67e8d390651a155e85c69146d2
+gopkg.in/src-d/go-log.v1,v1.0.1,h1:heWvX7J6qbGWbeFS/aRmiy1eYaT+QMV6wNvHDyMjQV4=,48f6c8a7bdc5436d296f388cd5d40ffb9c749e1e4ab1e455984efc61008fd5d7
+gopkg.in/stack.v0,v0.0.0-20141108040640-9b43fcefddd0,h1:lMH45EKqD8Nf6LwoF+43YOKjOAEEHQRVgDyG8RCV4MU=,a88c4cb4af34bb5c4dd69d0c771829331be7416d2f18d58ff599126f7b291984
+gopkg.in/stretchr/testify.v1,v1.2.2,h1:yhQC6Uy5CqibAIlk1wlusa/MJ3iAN49/BsR/dCCKz3M=,0126e73e5f2ce5687dec597bb276e11dc4031dbdf199e68de735bc67bf808149
+gopkg.in/telegram-bot-api.v3,v3.0.0,h1:Y6QmqOMwRKv5NUdlvzEBtEZChjsrqdTS6O858cvuCww=,03c58e32567a5cc4ec631cc226ecc99dd1113a7a98bab4778b02cde073ab5ed4
+gopkg.in/telegram-bot-api.v4,v4.6.4,h1:hpHWhzn4jTCsAJZZ2loNKfy2QWyPDRJVl3aTFXeMW8g=,01a91b240fb416bf83bcaaa07133cafac28fd8eb8f0f251f6a616beec88c92ac
+gopkg.in/testfixtures.v2,v2.5.0,h1:N08B7l2GzFQenyYbzqthDnKAA+cmb17iAZhhFxr7JHw=,05baac4af6e2855d296a5c045b27deb1b33d0a04cd0df96f029927f0742765a3
+gopkg.in/tomb.v1,v1.0.0-20141024135613-dd632973f1e7,h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=,34898dc0e38ba7a792ab74a3e0fa113116313fd9142ffb444b011fd392762186
+gopkg.in/tomb.v2,v2.0.0-20161208151619-d5d1b5820637,h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs=,15d93d96e1e8b2d8daf7b9e57a2a9193c0e676a2c6b63d9325bf34b53e93db00
+gopkg.in/tylerb/graceful.v1,v1.2.15,h1:1JmOyhKqAyX3BgTXMI84LwT6FOJ4tP2N9e2kwTCM0nQ=,0a8639cfe62508438ebf2cae721468b64d8cd2992fc0f80439c83c718f4608e0
+gopkg.in/urfave/cli.v1,v1.20.0,h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0=,413704688402027dc0f51666bac42152eb1668a73fa0e33858c3d2123c0592e5
+gopkg.in/warnings.v0,v0.1.2,h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=,c412b1f704c1e8ba59b6cfdb1072f8be847c03f77d6507c692913d6d9454e51c
+gopkg.in/yaml.v1,v1.0.0-20140924161607-9f9df34309c0,h1:POO/ycCATvegFmVuPpQzZFJ+pGZeX22Ufu6fibxDVjU=,7abff7973fdab7386de5a1e9e197d8dc50d41ded9d24ff914685900caa0eb742
+gopkg.in/yaml.v2,v2.2.4,h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=,815be785649ae218b51efd8e40b3b75de8f9b57dd43162386ffe3e76709f2a5d
+gorgonia.org/tensor,v0.9.2,h1:bVTWB68apbLfdrAlz5Ev3daGhfOhKuPkVFacMSNzpHs=,17562e7c1c6477b8b530d6236ab9a61228edbabe01c1cfb9ba23286c2394ba4c
+gorgonia.org/vecf32,v0.9.0,h1:PClazic1r+JVJ1dEzRXgeiVl4g1/Hf/w+wUSqnco1Xg=,618df2e604236a2d143958a3571f9939c8264ab2aaae7d8c71b897b728240a23
+gorgonia.org/vecf64,v0.9.0,h1:bgZDP5x0OzBF64PjMGC3EvTdOoMEcmfAh1VCUnZFm1A=,f57695832a12a6f1fbcc04cdaa267ed01fb6b8105f518590d64b2c63b9ac4c61
+gotest.tools,v2.2.0+incompatible,h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=,55fab831b2660201183b54d742602563d4e17e7125ee75788a309a4f6cb7285e
+grpc.go4.org,v0.0.0-20170609214715-11d0a25b4919,h1:tmXTu+dfa+d9Evp8NpJdgOy6+rt8/x4yG7qPBrtNfLY=,58b5c3cccf3e765d0f42918d458cddcd03fc28ff5d701790783677513a8446e3
+h12.io/socks,v1.0.0,h1:oiFI7YXv4h/0kBNcmAb5EkkoFJgYsOF88EQjMBxjitc=,3bf83125284ccabf811aa238954b442e39f53e3e068d4ddb6bf679ba2be28bbe
+honnef.co/go/js/dom,v0.0.0-20190526011328-ebc4cf92d81f,h1:b3Q9PqH+5NYHfIjNUEN+f8lYvBh9A25AX+kPh8dpYmc=,a65720d9c0339450c8818226693a85986549fb156ee4df65913682c350bd4d60
+honnef.co/go/js/util,v0.0.0-20150216223935-96b8dd9d1621,h1:QBApQyt1KyR3SvDWU8sHcIXeWTSCUamO7xQopvwuLWI=,db5638addc7638cc5cf2245cb9bcb19cf04a5912120330560149b54b4575ae50
+honnef.co/go/js/xhr,v0.0.0-20150307031022-00e3346113ae,h1:2dIKMawnBWvHzZrS8STyu/KdhYIOpnKQpp1WZm+K7TE=,d2a4a85c43fb4ccd9b5be6521450d272406a1722f7547f188f4a1d0cc65c4e13
+honnef.co/go/tools,v0.0.1-2019.2.3,h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=,539825114c487680f99df80f6107410e1e53bbfd5deb931b84d1faf2d221638e
+howett.net/plist,v0.0.0-20181124034731-591f970eefbb,h1:jhnBjNi9UFpfpl8YZhA9CrOqpnJdvzuiHsl/dnxl11M=,58c94cd949be714c0ee320d1be0cff3116fc829c412b9e7b816b03fb3c85f463
+istio.io/api,v0.0.0-20191029012234-9fe6a7da3673,h1:wxFykuQoScKAnEtKujAPqjwR8Aqo2LNtkoIvodxyCSs=,9ba545b9c5411725b709287b590082d140d3b29d924be351e38942f46c33ff55
+istio.io/gogo-genproto,v0.0.0-20190930162913-45029607206a,h1:w7zILua2dnYo9CxImhpNW4NE/8ZxEoc/wfBfHrhUhrE=,3b5a81f1807f48117d6691c8d007402a94b648f45f4446841a3f56229aa94aba
+istio.io/pkg,v0.0.0-20191029184635-5c2f5ef63692,h1:MT7e5hpQ8cGtKCeWIjtdluEVkIhkN2tw4iVkAzhWHYA=,887882f7e721e6d00dee301f0b029792bd04bd38c455ab7e5cf4f2bc5bf309df
+k8s.io/api,v0.0.0-20191031065753-b19d8caf39be,h1:X0MqzqUHuZj50SrMQFExejJfy67RKPf30Vt2nnpa4AA=,00a67ed9b84be18f621701796b42cee630c770c858582753fe0eb9c146ef93ff
+k8s.io/apiextensions-apiserver,v0.0.0-20191028232452-c47e10e6d5a3,h1:XxkWdWvPKTParJ1sXpUIvHJsJ2iIIj5Ebjxxy5YU1Zo=,2cb12eb8b2b0f95fb5d69b1f80b754b32ae46ef1f9636333fe27c6b17b1a6e19
+k8s.io/apimachinery,v0.0.0-20191030190112-bb31b70367b7,h1:81UYA9Qq3JXPpZMmRBnq6T3qU+b71Dvnm6sV3NSQTVk=,4c16a440acf7559b0974d99650c876969ad4811ddc76f9f5b7aa43afc34f66ec
+k8s.io/apiserver,v0.0.0-20191031110436-8cb875160ee0,h1:BGkQMPpKpx07hvq9AW64gifbf+zbAh/xUbB5OYXPvQ0=,baefad9177a1f8077c94a2d88b7e85deb7df79317d3d6d6afe8ca0be8261b1ae
+k8s.io/cli-runtime,v0.0.0-20191025231729-08207da42a69,h1:05z+vSvn9yPr7GTAt3MXpVc9VeU4D80HHwvJU6jC3D4=,46264219a6e1c8263acd610841a156086bbbdd43436a836effcd7285c37b0e8a
+k8s.io/client-go,v11.0.0+incompatible,h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o=,70925f536d409accf4f6ae3f20dafd81370ac096f848e99009141bea971103c2
+k8s.io/cloud-provider,v0.0.0-20191025232453-66dd06a864dd,h1:CxSfhPPmLwYFZquskmKvODMeEm82ZLc4eph47AdUp+o=,55623701c005f824ae847ecad409c6e61ef5fcfc6588b8dd2995a4a0991eeae8
+k8s.io/cluster-bootstrap,v0.0.0-20191025232351-410fafc3baf5,h1:P1mMVQngKW9pj1haVjyAtqViIBqkJmsITXsfuaHGRko=,ff50816340cdb73313e7233c3ff6df383c350102762b88ea0cc744910053c7bd
+k8s.io/code-generator,v0.0.0-20191029223907-9f431a56fdbc,h1:klQ4aWfZ3uk4UiSLkZZt5qQDI+7DwSdvbvyL5QUBHsQ=,1f63d3191c255d8fcc47ad24b3bd979865a3c12eca678b39f278c194c2ae560a
+k8s.io/component-base,v0.0.0-20191029070825-5e0e35147053,h1:W9/+uFw7olz+qQOCmSOG92c6j2YgIwagxqR9RWai/cE=,45bd9877048a57c3dfe7eb9c98bc1939775c73fdd6451afd055d7e4f7b9659bc
+k8s.io/cri-api,v0.0.0-20191025232916-446748cffdda,h1:HVTA1bXCQek+NF0xTZkryScnkGYWHkoeYAQVEVs73r8=,7aea277309740df8d1fad1c620901d60633569d755d2d0715d97bc553988d7be
+k8s.io/csi-api,v0.0.0-20190313123203-94ac839bf26c,h1:m3xih+9aI7l7Z/PvwzizV1J4vBvaUpkHrmagnGa5UNg=,0579fba2111dfd5b3cb62d7d234e52c54051176d9564ae3f0f2fdc69b31872b0
+k8s.io/gengo,v0.0.0-20191010091904-7fa3014cb28f,h1:eW/6wVuHNZgQJmFesyAxu0cvj0WAHHUuGaLbPcmNY3Q=,7fe69109e947204ee0b95705626e3c3b540faefb947d3426260f2991d1e4c036
+k8s.io/helm,v2.15.2+incompatible,h1:UjEb+c5BUZDGR9zU3dWG3OXASLIeqLeY0FCIx6ZyfTY=,377860d9db9fb1d45ffa90fe6ee79d7cfc4e91e5bc04183921480a823cf79ede
+k8s.io/klog,v1.0.0,h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=,a564b06078ddf014c5b793a7d36643d6fda31fc131e36b95cdea94ff838b99be
+k8s.io/kube-aggregator,v0.0.0-20191025230902-aa872b06629d,h1:ls0BmbSFkF5BhZN7grE+W5/X49QMU42RH6J9DWdP7UQ=,9a51f29a98f603acde33e3a10625e9ab603d7db29b3c2b2256d145adf7396393
+k8s.io/kube-controller-manager,v0.0.0-20191025232249-6de08162fd59,h1:bTAKwqwK2HvJVmpowb/ccyeV3wsxQZUtFQE1AqhMZ6I=,a1183bb172f19f6ae319da09c111a3f5dded663a9be85e18b9bceb131f03a342
+k8s.io/kube-openapi,v0.0.0-20190918143330-0270cf2f1c1d,h1:Xpe6sK+RY4ZgCTyZ3y273UmFmURhjtoJiwOMbQsXitY=,fb1dcd1508144991be0a243cea9a066944775ba4e9fa23c7ea038822e4e8e232
+k8s.io/kubelet,v0.0.0-20191025232041-e9c3b1e8a9ed,h1:ISiRMWhiLjmSsx24QQ6NJSgW1oKmAN59LCFzB7llrSk=,8c409ac5922dfb4cb0b8e6bb52823b2132e82faa3756dc3a94cdeabeaa3ff51e
+k8s.io/kubernetes,v1.11.10,h1:wCo67+wmguioiYv0ipIiTaXbVPfFBBjOTgIngeGGG+A=,7c8ca4ca473e9f2b5c6586a714209e98d99f193af84cdb3e8536a3d1e26be4bf
+k8s.io/metrics,v0.0.0-20191026071343-a166cc0bce8f,h1:D4AcfwGLY2gFDQaeK2QVyb8g4fy4Xzs0GopdwAgfSGc=,f4243455881a38d4962483ba5f2888220743a6ddece179c2b8f706815b75778f
+k8s.io/node-api,v0.0.0-20191025232816-761e5a80fde0,h1:V3FaBxwSQWPjPScXd5ioFx9+aREXGU24yFl8Gm7ib8w=,cb8718b6e148a66097f8cae4e4544dc55c674748202f9c21d07a2139b6e83fd1
+k8s.io/sample-apiserver,v0.0.0-20191030110742-cbfc6c263d7e,h1:9bsKcUCncu1Qg3A4pB5ZySTM0JMEZW4qgybjVhmaS4A=,91d701af12da2ff6cde6f07d53547885faafa32c2eadfa8d4614b4d814a854b9
+k8s.io/sample-controller,v0.0.0-20191025231305-d7b8b8302943,h1:ZYb6if7+Qa5kXFidUsQRLFDyZjCjRyG1sFf6GpZaA70=,07c3e3a95d0fac07a247a98c38448a8fc4ab0069ad599ec06ac9405df88b470b
+k8s.io/utils,v0.0.0-20191030222137-2b95a09bc58d,h1:1P0iBJsBzxRmR+dIFnM+Iu4aLxnoa7lBqozW/0uHbT8=,e21be6d971127d4650bd13525a2d2627b2a98dbb8589f168b734a45d50f3ea22
+launchpad.net/gocheck,v0.0.0-20140225173054-000000000087,h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54=,1a1d9b10f2c69564e69993e4340d5299392a518d895ec06502e842e6c69f4857
+layeh.com/radius,v0.0.0-20190322222518-890bc1058917,h1:BDXFaFzUt5EIqe/4wrTc4AcYZWP6iC6Ult+jQWLh5eU=,5eb6b6a05a5f89bc114f37085deda268f895a46621aee2e36649b8d80061357e
+leb.io/aeshash,v0.0.0-20190627052759-9e6b40329b3b,h1:MG17Tc0pA3XmFTsPwklMMEfcos3pTFnVYM4A0YfVSbU=,a78b48ac18e98ea68dacce16cd94c9074688a0b125f824f047313a33b264ea88
+leb.io/hashland,v0.0.0-20171003003232-07375b562dea,h1:s9IkzZTqYqw77voO6taUZHc0C1B096h4T/kQtujGApE=,0698177f24cbde0a7b45495e7fe976fe7623f2b9205995b7d91fd2e7b0f0e243
+leb.io/hrff,v0.0.0-20170927164517-757f8bd43e20,h1:9CHS8LIq9MDwUsAaCHUsbUq7zb5lSjLQYWlJ/AbMZKg=,538008712599401a903a7982714c0a9ae745221042d3dfb1437bc508d8fb9e96
+llvm.org/llvm,v0.0.0-20191022153947-000000375505,h1:cncItmsQ0kcXFrnkQZv2TGle2ELPCEDi3Q36Kf2T3yg=,3f48da9846fc0f69ccc447ead4480f8c7f2b44b0c24b98a793d36d8cb2a572c0
+modernc.org/cc,v1.0.0,h1:nPibNuDEx6tvYrUAtvDTTw98rx5juGsa5zuDnKwEEQQ=,24711e9b28b0d79dd32438eeb7debd86b850350f5f7749b7af640422ecf6b93b
+modernc.org/golex,v1.0.0,h1:wWpDlbK8ejRfSyi0frMyhilD3JBvtcx2AdGDnU+JtsE=,335133038991d7feaba5349ac2385db7b49601bba0904abf680803ee2d3c99df
+modernc.org/mathutil,v1.0.0,h1:93vKjrJopTPrtTNpZ8XIovER7iCIH1QU7wNbOQXC60I=,766ad95195543fe1ac217ce9f54e1fb43119c25db2b89013b9ef5477ad2dd9d1
+modernc.org/strutil,v1.0.0,h1:XVFtQwFVwc02Wk+0L/Z/zDDXO81r5Lhe6iMKmGX3KhE=,4bbca362df97450c6f24b90b7dc80b97ecf19e5f0f5954655b26f335a0b8f378
+modernc.org/xc,v1.0.0,h1:7ccXrupWZIS3twbUGrtKmHS2DXY6xegFua+6O3xgAFU=,ef80e60acacc023cd294eef2555bd348f74c1bcd22c8cfbbd2472cb91e35900d
+moul.io/http2curl,v1.0.0,h1:6XwpyZOYsgZJrU8exnG87ncVkU1FVCcTRpwzOkTDUi8=,422e2b8833089b001da02c6d7235ecb4c0591bb585fee125cbd0d72b1371dba5
+mvdan.cc/sh,v2.6.0+incompatible,h1:BLDuJ+D75OCaBF7W70+2oALi8aKAjcAiDBNmmwR8BQA=,c5c335f4ae8f1c4228a01710b84ba8f847709b1920d2beeddc4648e62cdd25f7
+mvdan.cc/sh/v3,v3.0.0-alpha1,h1:ao/4li6H9nZe5HDXA14cynXoq90+DLZz0HmjZE/qjhA=,5da16556569786a039c24229b55eb0f76049c2293ac96a9b978cede87676962e
+mvdan.cc/xurls/v2,v2.0.0,h1:r1zSOSNS/kqtpmATyMMMvaZ4/djsesbYz5kr0+qMRWc=,67e609a744e93b7ba05adee985d7e3471e6d414cea611ac73206e007a5e03082
+myitcv.io,v0.0.0-20190927111909-7837eed0ff8e,h1:aTqeLMcNZAhWxtvBgs0fbjTxg5BuNvHYnLo1lhSq9hE=,0d734b4e576c5c34dd9788481761864faef6cacdd735296d22f885b211fe9c70
+pack.ag/amqp,v0.11.2,h1:cuNDWLUTbKRtEZwhB0WQBXf9pGbm87pUBXQhvcFxBWg=,7cdc81d1aeef4ad24c4a49f6227aac060ee193587c95d48bfe4437beaf08310a
+periph.io/x/periph,v3.6.2+incompatible,h1:B9vqhYVuhKtr6bXua8N9GeBEvD7yanczCvE0wU2LEqw=,aeb77a51a9e20e0414e7ea7c9a3a30302fcb5ffc5cf4dd41c3455ec0c3d7b1bc
+perkeep.org,v0.0.0-20190926184543-d342b0e26632,h1:6ZKRr0VZtsfdHyYDJ/G9rCy7z8jGfrpmYANf0BR+vJM=,fd9e06dfc30d3bcb49399fd062094dfdf364a8344d409541896cb96d36465ade
+rsc.io/binaryregexp,v0.2.0,h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE=,b3e706aa278fa7f880d32fa1cc40ef8282d1fc7d6e00356579ed0db88f3b0047
+rsc.io/goversion,v1.2.0,h1:SPn+NLTiAG7w30IRK/DKp1BjvpWabYgxlLp/+kx5J8w=,f8426f6078b1d1b4e29a8c6223603680169c7c0a8789d2aee7e401a46ff6343f
+rsc.io/pdf,v0.1.1,h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4=,79bf310e399cf0e2d8aa61536750d2a6999c5ca884e7a27faf88d3701cd5ba8f
+rsc.io/qr,v0.1.0,h1:M/sAxsU2J5mlQ4W84Bxga2EgdQqOaAliipcjPmMUM5Q=,fd09c124eb71d01dab3a0116eac47a6fce78f34bbdd84620b2dc01b90582b11c
+sigs.k8s.io/cluster-api,v0.2.7,h1:WjhtuvyjnMgo62kKlVizhI/nYs4DJxHNf+ZMSk/uUsM=,1e3767e7d0f655b72a52eab40e122779ccd1f734c06b9c6488ea9615a3db7b24
+sigs.k8s.io/controller-runtime,v0.3.0,h1:ZtdgqJXVHsIytjdmDuk0QjagnzyLq9FjojXRqIp+dU4=,f37a21668e57315e7248169bec6d4a71f86bcf53d7528c9752e7b459ee74efe0
+sigs.k8s.io/kustomize,v2.0.3+incompatible,h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=,e0f6ad3aaaf7160abcb5e7b16f711c13aebe876833ae9e6ad6f858f31641bf62
+sigs.k8s.io/structured-merge-diff,v0.0.0-20191023203907-336d3378ca53,h1:WCMuuk4OLJ1WdEK3fx+hroiutCODdAGwDlL2Dj4mpa0=,b389a2eafcce0dcef4ca1052942980f26b62030da007b3a84a653de5c0f91668
+sigs.k8s.io/testing_frameworks,v0.1.2-0.20190130140139-57f07443c2d4,h1:GtDhkj3cF4A4IW+A9LScsuxvJqA9DE7G7PGH1f8B07U=,bfb65beb3dda386efc0c0ff9237a07877cec71922f4d3dc1f4a40d5fcaa090a9
+sigs.k8s.io/yaml,v1.1.0,h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=,a0d39252e8665a428a8cb9d4dfc9cbea07b7ae90ae62e7cf3651be719adf515a
+sofastack.io/sofa-mosn,v0.0.0-20191101130505-becc7a6dc50c,h1:8IAozA6SkwfqCAF7fVyy8gu4FdyJvH5iBC12WhiocB8=,0ed9cc5b20e6233051bb4de2ffee5c7f3365704fe01d28e87237d9e8041a786d
+sourcegraph.com/sourcegraph/appdash,v0.0.0-20190107175209-d9ea5c54f7dc,h1:lmf242UNy8ucQUSUse9oXtyxHb6kaF82XRLqeVDXXhA=,49e3fd73d6218c97f49266f0e32bbdab1b6352f2f40da8d1aa98ee8dfdeec072
+sourcegraph.com/sourcegraph/appdash-data,v0.0.0-20151005221446-73f23eafcf67,h1:e1sMhtVq9AfcEy8AXNb8eSg6gbzfdpYhoNqnPJa+GzI=,382adefecd62bb79172e2552bcfb7d45f47122f9bd22259b0566b26fb2627b87
+sourcegraph.com/sourcegraph/go-diff,v0.5.0,h1:eTiIR0CoWjGzJcnQ3OkhIl/b9GJovq4lSAVRt0ZFEG8=,2c5eaad1d3743b3d4bd6de70459a413e62d1753673d5b96402dda27508454b3b
+sourcegraph.com/sqs/pbtypes,v0.0.0-20180604144634-d3ebe8f20ae4,h1:JPJh2pk3+X4lXAkZIk2RuE/7/FoK9maXw+TNPJhVS/c=,6750f8618ecbde1668de332800ec01d713debb145dee395c23fc9a373c207fe3
+storj.io/drpc,v0.0.7-0.20191021224058-08e7133752cd,h1:Oh7Nww1cgFA3fhrCOheDwQ0VcUKFcO1LsBSJEgiGgUQ=,51befd9e6e3aa6cfb9f5b56e47b3cd59715dbe656d0a12cfbb0282609b5456dd
+storj.io/storj,v0.24.5,h1:dWqApMsdhPoUufrljPQC1gZWkYcSTjRr5AoZ7mrSjCw=,ce0628bdcce2b8f0241d27993431d343d212b2e55323510bf657928001c2fb26
+strk.kbt.io/projects/go/libravatar,v0.0.0-20160628055650-5eed7bff870a,h1:8q33ShxKXRwQ7JVd1ZnhIU3hZhwwn0Le+4fTeAackuM=,be48b3949775d6ba0dd3105d7d31d338fede9fbd1471b41fe861f1cfcabbf85c
+v.io/x/lib,v0.1.4,h1:PCDfluqBeRbA7OgDIs9tIpT+z6ZNZ5VMeR+t7h/K2ig=,411c5ded56ba1b69269c37748d184954089c320f43ee76beb0c53f7c598baeaf
+vbom.ml/util,v0.0.0-20180919145318-efcd4e0f9787,h1:O69FD9pJA4WUZlEwYatBEEkRWKQ5cKodWpdKTrCS/iQ=,abbc7a9ac1d820f336ccbe247404800d0f79859b4e4412f0d107aebbb564f920
+vitess.io/vitess,v2.1.1+incompatible,h1:nuuGHiWYWpudD3gOCLeGzol2EJ25e/u5Wer2wV1O130=,8f823ede6775b4f5b3f6cd4c04b3b6be453416e124362a8d68fa2e829429fa68
+xorm.io/builder,v0.3.6,h1:ha28mQ2M+TFx96Hxo+iq6tQgnkC9IZkM6D8w9sKHHF8=,8f16bb96bf2f75b4813be77072a966d1f2248a38f2c7afff4132b666876310a7
+xorm.io/core,v0.7.2,h1:mEO22A2Z7a3fPaZMk6gKL/jMD80iiyNwRrX5HOv3XLw=,24c93962a78b2a177ff5c66cd43921eb1e8b13290d0e8a4d87c6f075a81c4531
diff --git a/libgo/go/cmd/go/internal/modfetch/zip_sum_test/zip_sum_test.go b/libgo/go/cmd/go/internal/modfetch/zip_sum_test/zip_sum_test.go
new file mode 100644
index 00000000000..331d634d102
--- /dev/null
+++ b/libgo/go/cmd/go/internal/modfetch/zip_sum_test/zip_sum_test.go
@@ -0,0 +1,230 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package zip_sum_test tests that the module zip files produced by modfetch
+// have consistent content sums. Ideally the zip files themselves are also
+// stable over time, though this is not strictly necessary.
+//
+// This test loads a table from testdata/zip_sums.csv. The table has columns
+// for module path, version, content sum, and zip file hash. The table
+// includes a large number of real modules. The test downloads these modules
+// in direct mode and verifies the zip files.
+//
+// This test is very slow, and it depends on outside modules that change
+// frequently, so this is a manual test. To enable it, pass the -zipsum flag.
+package zip_sum_test
+
+import (
+ "crypto/sha256"
+ "encoding/csv"
+ "encoding/hex"
+ "flag"
+ "fmt"
+ "internal/testenv"
+ "io"
+ "io/ioutil"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+
+ "cmd/go/internal/cfg"
+ "cmd/go/internal/modfetch"
+ "cmd/go/internal/modload"
+
+ "golang.org/x/mod/module"
+)
+
+var (
+ updateTestData = flag.Bool("u", false, "when set, tests may update files in testdata instead of failing")
+ enableZipSum = flag.Bool("zipsum", false, "enable TestZipSums")
+ debugZipSum = flag.Bool("testwork", false, "when set, TestZipSums will preserve its test directory")
+ modCacheDir = flag.String("zipsumcache", "", "module cache to use instead of temp directory")
+ shardCount = flag.Int("zipsumshardcount", 1, "number of shards to divide TestZipSums into")
+ shardIndex = flag.Int("zipsumshard", 0, "index of TestZipSums shard to test (0 <= zipsumshard < zipsumshardcount)")
+)
+
+const zipSumsPath = "testdata/zip_sums.csv"
+
+type zipSumTest struct {
+ m module.Version
+ wantSum, wantFileHash string
+}
+
+func TestZipSums(t *testing.T) {
+ if !*enableZipSum {
+ // This test is very slow and heavily dependent on external repositories.
+ // Only run it explicitly.
+ t.Skip("TestZipSum not enabled with -zipsum")
+ }
+ if *shardCount < 1 {
+ t.Fatal("-zipsumshardcount must be a positive integer")
+ }
+ if *shardIndex < 0 || *shardCount <= *shardIndex {
+ t.Fatal("-zipsumshard must be between 0 and -zipsumshardcount")
+ }
+
+ testenv.MustHaveGoBuild(t)
+ testenv.MustHaveExternalNetwork(t)
+ testenv.MustHaveExecPath(t, "bzr")
+ testenv.MustHaveExecPath(t, "git")
+ // TODO(jayconrod): add hg, svn, and fossil modules to testdata.
+ // Could not find any for now.
+
+ tests, err := readZipSumTests()
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if *modCacheDir != "" {
+ cfg.BuildContext.GOPATH = *modCacheDir
+ } else {
+ tmpDir, err := ioutil.TempDir("", "TestZipSums")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if *debugZipSum {
+ fmt.Fprintf(os.Stderr, "TestZipSums: modCacheDir: %s\n", tmpDir)
+ } else {
+ defer os.RemoveAll(tmpDir)
+ }
+ cfg.BuildContext.GOPATH = tmpDir
+ }
+
+ cfg.GOPROXY = "direct"
+ cfg.GOSUMDB = "off"
+ modload.Init()
+
+ // Shard tests by downloading only every nth module when shard flags are set.
+ // This makes it easier to test small groups of modules quickly. We avoid
+ // testing similarly named modules together (the list is sorted by module
+ // path and version).
+ if *shardCount > 1 {
+ r := *shardIndex
+ w := 0
+ for r < len(tests) {
+ tests[w] = tests[r]
+ w++
+ r += *shardCount
+ }
+ tests = tests[:w]
+ }
+
+ // Download modules with a rate limit. We may run out of file descriptors
+ // or cause timeouts without a limit.
+ needUpdate := false
+ for i := range tests {
+ test := &tests[i]
+ name := fmt.Sprintf("%s@%s", strings.ReplaceAll(test.m.Path, "/", "_"), test.m.Version)
+ t.Run(name, func(t *testing.T) {
+ t.Parallel()
+ zipPath, err := modfetch.DownloadZip(test.m)
+ if err != nil {
+ if *updateTestData {
+ t.Logf("%s: could not download module: %s (will remove from testdata)", test.m, err)
+ test.m.Path = "" // mark for deletion
+ needUpdate = true
+ } else {
+ t.Errorf("%s: could not download mdoule: %s", test.m, err)
+ }
+ return
+ }
+
+ sum := modfetch.Sum(test.m)
+ if sum != test.wantSum {
+ if *updateTestData {
+ t.Logf("%s: updating content sum to %s", test.m, sum)
+ test.wantSum = sum
+ needUpdate = true
+ } else {
+ t.Errorf("%s: got content sum %s; want sum %s", test.m, sum, test.wantSum)
+ return
+ }
+ }
+
+ h := sha256.New()
+ f, err := os.Open(zipPath)
+ if err != nil {
+ t.Errorf("%s: %v", test.m, err)
+ }
+ defer f.Close()
+ if _, err := io.Copy(h, f); err != nil {
+ t.Errorf("%s: %v", test.m, err)
+ }
+ zipHash := hex.EncodeToString(h.Sum(nil))
+ if zipHash != test.wantFileHash {
+ if *updateTestData {
+ t.Logf("%s: updating zip file hash to %s", test.m, zipHash)
+ test.wantFileHash = zipHash
+ needUpdate = true
+ } else {
+ t.Errorf("%s: got zip file hash %s; want hash %s (but content sum matches)", test.m, zipHash, test.wantFileHash)
+ }
+ }
+ })
+ }
+
+ if needUpdate {
+ // Remove tests marked for deletion
+ r, w := 0, 0
+ for r < len(tests) {
+ if tests[r].m.Path != "" {
+ tests[w] = tests[r]
+ w++
+ }
+ r++
+ }
+ tests = tests[:w]
+
+ if err := writeZipSumTests(tests); err != nil {
+ t.Error(err)
+ }
+ }
+}
+
+func readZipSumTests() ([]zipSumTest, error) {
+ f, err := os.Open(filepath.FromSlash(zipSumsPath))
+ if err != nil {
+ return nil, err
+ }
+ defer f.Close()
+ r := csv.NewReader(f)
+
+ var tests []zipSumTest
+ for {
+ line, err := r.Read()
+ if err == io.EOF {
+ break
+ } else if err != nil {
+ return nil, err
+ } else if len(line) != 4 {
+ return nil, fmt.Errorf("%s:%d: malformed line", f.Name(), len(tests)+1)
+ }
+ test := zipSumTest{m: module.Version{Path: line[0], Version: line[1]}, wantSum: line[2], wantFileHash: line[3]}
+ tests = append(tests, test)
+ }
+ return tests, nil
+}
+
+func writeZipSumTests(tests []zipSumTest) (err error) {
+ f, err := os.Create(filepath.FromSlash(zipSumsPath))
+ if err != nil {
+ return err
+ }
+ defer func() {
+ if cerr := f.Close(); err == nil && cerr != nil {
+ err = cerr
+ }
+ }()
+ w := csv.NewWriter(f)
+ line := make([]string, 0, 4)
+ for _, test := range tests {
+ line = append(line[:0], test.m.Path, test.m.Version, test.wantSum, test.wantFileHash)
+ if err := w.Write(line); err != nil {
+ return err
+ }
+ }
+ w.Flush()
+ return nil
+}
diff --git a/libgo/go/cmd/go/internal/modfile/gopkgin.go b/libgo/go/cmd/go/internal/modfile/gopkgin.go
deleted file mode 100644
index c94b3848a0e..00000000000
--- a/libgo/go/cmd/go/internal/modfile/gopkgin.go
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// TODO: Figure out what gopkg.in should do.
-
-package modfile
-
-import "strings"
-
-// ParseGopkgIn splits gopkg.in import paths into their constituent parts
-func ParseGopkgIn(path string) (root, repo, major, subdir string, ok bool) {
- if !strings.HasPrefix(path, "gopkg.in/") {
- return
- }
- f := strings.Split(path, "/")
- if len(f) >= 2 {
- if elem, v, ok := dotV(f[1]); ok {
- root = strings.Join(f[:2], "/")
- repo = "github.com/go-" + elem + "/" + elem
- major = v
- subdir = strings.Join(f[2:], "/")
- return root, repo, major, subdir, true
- }
- }
- if len(f) >= 3 {
- if elem, v, ok := dotV(f[2]); ok {
- root = strings.Join(f[:3], "/")
- repo = "github.com/" + f[1] + "/" + elem
- major = v
- subdir = strings.Join(f[3:], "/")
- return root, repo, major, subdir, true
- }
- }
- return
-}
-
-func dotV(name string) (elem, v string, ok bool) {
- i := len(name) - 1
- for i >= 0 && '0' <= name[i] && name[i] <= '9' {
- i--
- }
- if i <= 2 || i+1 >= len(name) || name[i-1] != '.' || name[i] != 'v' || name[i+1] == '0' && len(name) != i+2 {
- return "", "", false
- }
- return name[:i-1], name[i:], true
-}
diff --git a/libgo/go/cmd/go/internal/modfile/print.go b/libgo/go/cmd/go/internal/modfile/print.go
deleted file mode 100644
index cefc43b141c..00000000000
--- a/libgo/go/cmd/go/internal/modfile/print.go
+++ /dev/null
@@ -1,164 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Module file printer.
-
-package modfile
-
-import (
- "bytes"
- "fmt"
- "strings"
-)
-
-func Format(f *FileSyntax) []byte {
- pr := &printer{}
- pr.file(f)
- return pr.Bytes()
-}
-
-// A printer collects the state during printing of a file or expression.
-type printer struct {
- bytes.Buffer // output buffer
- comment []Comment // pending end-of-line comments
- margin int // left margin (indent), a number of tabs
-}
-
-// printf prints to the buffer.
-func (p *printer) printf(format string, args ...interface{}) {
- fmt.Fprintf(p, format, args...)
-}
-
-// indent returns the position on the current line, in bytes, 0-indexed.
-func (p *printer) indent() int {
- b := p.Bytes()
- n := 0
- for n < len(b) && b[len(b)-1-n] != '\n' {
- n++
- }
- return n
-}
-
-// newline ends the current line, flushing end-of-line comments.
-func (p *printer) newline() {
- if len(p.comment) > 0 {
- p.printf(" ")
- for i, com := range p.comment {
- if i > 0 {
- p.trim()
- p.printf("\n")
- for i := 0; i < p.margin; i++ {
- p.printf("\t")
- }
- }
- p.printf("%s", strings.TrimSpace(com.Token))
- }
- p.comment = p.comment[:0]
- }
-
- p.trim()
- p.printf("\n")
- for i := 0; i < p.margin; i++ {
- p.printf("\t")
- }
-}
-
-// trim removes trailing spaces and tabs from the current line.
-func (p *printer) trim() {
- // Remove trailing spaces and tabs from line we're about to end.
- b := p.Bytes()
- n := len(b)
- for n > 0 && (b[n-1] == '\t' || b[n-1] == ' ') {
- n--
- }
- p.Truncate(n)
-}
-
-// file formats the given file into the print buffer.
-func (p *printer) file(f *FileSyntax) {
- for _, com := range f.Before {
- p.printf("%s", strings.TrimSpace(com.Token))
- p.newline()
- }
-
- for i, stmt := range f.Stmt {
- switch x := stmt.(type) {
- case *CommentBlock:
- // comments already handled
- p.expr(x)
-
- default:
- p.expr(x)
- p.newline()
- }
-
- for _, com := range stmt.Comment().After {
- p.printf("%s", strings.TrimSpace(com.Token))
- p.newline()
- }
-
- if i+1 < len(f.Stmt) {
- p.newline()
- }
- }
-}
-
-func (p *printer) expr(x Expr) {
- // Emit line-comments preceding this expression.
- if before := x.Comment().Before; len(before) > 0 {
- // Want to print a line comment.
- // Line comments must be at the current margin.
- p.trim()
- if p.indent() > 0 {
- // There's other text on the line. Start a new line.
- p.printf("\n")
- }
- // Re-indent to margin.
- for i := 0; i < p.margin; i++ {
- p.printf("\t")
- }
- for _, com := range before {
- p.printf("%s", strings.TrimSpace(com.Token))
- p.newline()
- }
- }
-
- switch x := x.(type) {
- default:
- panic(fmt.Errorf("printer: unexpected type %T", x))
-
- case *CommentBlock:
- // done
-
- case *LParen:
- p.printf("(")
- case *RParen:
- p.printf(")")
-
- case *Line:
- sep := ""
- for _, tok := range x.Token {
- p.printf("%s%s", sep, tok)
- sep = " "
- }
-
- case *LineBlock:
- for _, tok := range x.Token {
- p.printf("%s ", tok)
- }
- p.expr(&x.LParen)
- p.margin++
- for _, l := range x.Line {
- p.newline()
- p.expr(l)
- }
- p.margin--
- p.newline()
- p.expr(&x.RParen)
- }
-
- // Queue end-of-line comments for printing when we
- // reach the end of the line.
- p.comment = append(p.comment, x.Comment().Suffix...)
-}
diff --git a/libgo/go/cmd/go/internal/modfile/read.go b/libgo/go/cmd/go/internal/modfile/read.go
deleted file mode 100644
index 1d81ff1ab7a..00000000000
--- a/libgo/go/cmd/go/internal/modfile/read.go
+++ /dev/null
@@ -1,869 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Module file parser.
-// This is a simplified copy of Google's buildifier parser.
-
-package modfile
-
-import (
- "bytes"
- "fmt"
- "os"
- "strconv"
- "strings"
- "unicode"
- "unicode/utf8"
-)
-
-// A Position describes the position between two bytes of input.
-type Position struct {
- Line int // line in input (starting at 1)
- LineRune int // rune in line (starting at 1)
- Byte int // byte in input (starting at 0)
-}
-
-// add returns the position at the end of s, assuming it starts at p.
-func (p Position) add(s string) Position {
- p.Byte += len(s)
- if n := strings.Count(s, "\n"); n > 0 {
- p.Line += n
- s = s[strings.LastIndex(s, "\n")+1:]
- p.LineRune = 1
- }
- p.LineRune += utf8.RuneCountInString(s)
- return p
-}
-
-// An Expr represents an input element.
-type Expr interface {
- // Span returns the start and end position of the expression,
- // excluding leading or trailing comments.
- Span() (start, end Position)
-
- // Comment returns the comments attached to the expression.
- // This method would normally be named 'Comments' but that
- // would interfere with embedding a type of the same name.
- Comment() *Comments
-}
-
-// A Comment represents a single // comment.
-type Comment struct {
- Start Position
- Token string // without trailing newline
- Suffix bool // an end of line (not whole line) comment
-}
-
-// Comments collects the comments associated with an expression.
-type Comments struct {
- Before []Comment // whole-line comments before this expression
- Suffix []Comment // end-of-line comments after this expression
-
- // For top-level expressions only, After lists whole-line
- // comments following the expression.
- After []Comment
-}
-
-// Comment returns the receiver. This isn't useful by itself, but
-// a Comments struct is embedded into all the expression
-// implementation types, and this gives each of those a Comment
-// method to satisfy the Expr interface.
-func (c *Comments) Comment() *Comments {
- return c
-}
-
-// A FileSyntax represents an entire go.mod file.
-type FileSyntax struct {
- Name string // file path
- Comments
- Stmt []Expr
-}
-
-func (x *FileSyntax) Span() (start, end Position) {
- if len(x.Stmt) == 0 {
- return
- }
- start, _ = x.Stmt[0].Span()
- _, end = x.Stmt[len(x.Stmt)-1].Span()
- return start, end
-}
-
-func (x *FileSyntax) addLine(hint Expr, tokens ...string) *Line {
- if hint == nil {
- // If no hint given, add to the last statement of the given type.
- Loop:
- for i := len(x.Stmt) - 1; i >= 0; i-- {
- stmt := x.Stmt[i]
- switch stmt := stmt.(type) {
- case *Line:
- if stmt.Token != nil && stmt.Token[0] == tokens[0] {
- hint = stmt
- break Loop
- }
- case *LineBlock:
- if stmt.Token[0] == tokens[0] {
- hint = stmt
- break Loop
- }
- }
- }
- }
-
- if hint != nil {
- for i, stmt := range x.Stmt {
- switch stmt := stmt.(type) {
- case *Line:
- if stmt == hint {
- // Convert line to line block.
- stmt.InBlock = true
- block := &LineBlock{Token: stmt.Token[:1], Line: []*Line{stmt}}
- stmt.Token = stmt.Token[1:]
- x.Stmt[i] = block
- new := &Line{Token: tokens[1:], InBlock: true}
- block.Line = append(block.Line, new)
- return new
- }
- case *LineBlock:
- if stmt == hint {
- new := &Line{Token: tokens[1:], InBlock: true}
- stmt.Line = append(stmt.Line, new)
- return new
- }
- for j, line := range stmt.Line {
- if line == hint {
- // Add new line after hint.
- stmt.Line = append(stmt.Line, nil)
- copy(stmt.Line[j+2:], stmt.Line[j+1:])
- new := &Line{Token: tokens[1:], InBlock: true}
- stmt.Line[j+1] = new
- return new
- }
- }
- }
- }
- }
-
- new := &Line{Token: tokens}
- x.Stmt = append(x.Stmt, new)
- return new
-}
-
-func (x *FileSyntax) updateLine(line *Line, tokens ...string) {
- if line.InBlock {
- tokens = tokens[1:]
- }
- line.Token = tokens
-}
-
-func (x *FileSyntax) removeLine(line *Line) {
- line.Token = nil
-}
-
-// Cleanup cleans up the file syntax x after any edit operations.
-// To avoid quadratic behavior, removeLine marks the line as dead
-// by setting line.Token = nil but does not remove it from the slice
-// in which it appears. After edits have all been indicated,
-// calling Cleanup cleans out the dead lines.
-func (x *FileSyntax) Cleanup() {
- w := 0
- for _, stmt := range x.Stmt {
- switch stmt := stmt.(type) {
- case *Line:
- if stmt.Token == nil {
- continue
- }
- case *LineBlock:
- ww := 0
- for _, line := range stmt.Line {
- if line.Token != nil {
- stmt.Line[ww] = line
- ww++
- }
- }
- if ww == 0 {
- continue
- }
- if ww == 1 {
- // Collapse block into single line.
- line := &Line{
- Comments: Comments{
- Before: commentsAdd(stmt.Before, stmt.Line[0].Before),
- Suffix: commentsAdd(stmt.Line[0].Suffix, stmt.Suffix),
- After: commentsAdd(stmt.Line[0].After, stmt.After),
- },
- Token: stringsAdd(stmt.Token, stmt.Line[0].Token),
- }
- x.Stmt[w] = line
- w++
- continue
- }
- stmt.Line = stmt.Line[:ww]
- }
- x.Stmt[w] = stmt
- w++
- }
- x.Stmt = x.Stmt[:w]
-}
-
-func commentsAdd(x, y []Comment) []Comment {
- return append(x[:len(x):len(x)], y...)
-}
-
-func stringsAdd(x, y []string) []string {
- return append(x[:len(x):len(x)], y...)
-}
-
-// A CommentBlock represents a top-level block of comments separate
-// from any rule.
-type CommentBlock struct {
- Comments
- Start Position
-}
-
-func (x *CommentBlock) Span() (start, end Position) {
- return x.Start, x.Start
-}
-
-// A Line is a single line of tokens.
-type Line struct {
- Comments
- Start Position
- Token []string
- InBlock bool
- End Position
-}
-
-func (x *Line) Span() (start, end Position) {
- return x.Start, x.End
-}
-
-// A LineBlock is a factored block of lines, like
-//
-// require (
-// "x"
-// "y"
-// )
-//
-type LineBlock struct {
- Comments
- Start Position
- LParen LParen
- Token []string
- Line []*Line
- RParen RParen
-}
-
-func (x *LineBlock) Span() (start, end Position) {
- return x.Start, x.RParen.Pos.add(")")
-}
-
-// An LParen represents the beginning of a parenthesized line block.
-// It is a place to store suffix comments.
-type LParen struct {
- Comments
- Pos Position
-}
-
-func (x *LParen) Span() (start, end Position) {
- return x.Pos, x.Pos.add(")")
-}
-
-// An RParen represents the end of a parenthesized line block.
-// It is a place to store whole-line (before) comments.
-type RParen struct {
- Comments
- Pos Position
-}
-
-func (x *RParen) Span() (start, end Position) {
- return x.Pos, x.Pos.add(")")
-}
-
-// An input represents a single input file being parsed.
-type input struct {
- // Lexing state.
- filename string // name of input file, for errors
- complete []byte // entire input
- remaining []byte // remaining input
- token []byte // token being scanned
- lastToken string // most recently returned token, for error messages
- pos Position // current input position
- comments []Comment // accumulated comments
- endRule int // position of end of current rule
-
- // Parser state.
- file *FileSyntax // returned top-level syntax tree
- parseError error // error encountered during parsing
-
- // Comment assignment state.
- pre []Expr // all expressions, in preorder traversal
- post []Expr // all expressions, in postorder traversal
-}
-
-func newInput(filename string, data []byte) *input {
- return &input{
- filename: filename,
- complete: data,
- remaining: data,
- pos: Position{Line: 1, LineRune: 1, Byte: 0},
- }
-}
-
-// parse parses the input file.
-func parse(file string, data []byte) (f *FileSyntax, err error) {
- in := newInput(file, data)
- // The parser panics for both routine errors like syntax errors
- // and for programmer bugs like array index errors.
- // Turn both into error returns. Catching bug panics is
- // especially important when processing many files.
- defer func() {
- if e := recover(); e != nil {
- if e == in.parseError {
- err = in.parseError
- } else {
- err = fmt.Errorf("%s:%d:%d: internal error: %v", in.filename, in.pos.Line, in.pos.LineRune, e)
- }
- }
- }()
-
- // Invoke the parser.
- in.parseFile()
- if in.parseError != nil {
- return nil, in.parseError
- }
- in.file.Name = in.filename
-
- // Assign comments to nearby syntax.
- in.assignComments()
-
- return in.file, nil
-}
-
-// Error is called to report an error.
-// The reason s is often "syntax error".
-// Error does not return: it panics.
-func (in *input) Error(s string) {
- if s == "syntax error" && in.lastToken != "" {
- s += " near " + in.lastToken
- }
- in.parseError = fmt.Errorf("%s:%d:%d: %v", in.filename, in.pos.Line, in.pos.LineRune, s)
- panic(in.parseError)
-}
-
-// eof reports whether the input has reached end of file.
-func (in *input) eof() bool {
- return len(in.remaining) == 0
-}
-
-// peekRune returns the next rune in the input without consuming it.
-func (in *input) peekRune() int {
- if len(in.remaining) == 0 {
- return 0
- }
- r, _ := utf8.DecodeRune(in.remaining)
- return int(r)
-}
-
-// peekPrefix reports whether the remaining input begins with the given prefix.
-func (in *input) peekPrefix(prefix string) bool {
- // This is like bytes.HasPrefix(in.remaining, []byte(prefix))
- // but without the allocation of the []byte copy of prefix.
- for i := 0; i < len(prefix); i++ {
- if i >= len(in.remaining) || in.remaining[i] != prefix[i] {
- return false
- }
- }
- return true
-}
-
-// readRune consumes and returns the next rune in the input.
-func (in *input) readRune() int {
- if len(in.remaining) == 0 {
- in.Error("internal lexer error: readRune at EOF")
- }
- r, size := utf8.DecodeRune(in.remaining)
- in.remaining = in.remaining[size:]
- if r == '\n' {
- in.pos.Line++
- in.pos.LineRune = 1
- } else {
- in.pos.LineRune++
- }
- in.pos.Byte += size
- return int(r)
-}
-
-type symType struct {
- pos Position
- endPos Position
- text string
-}
-
-// startToken marks the beginning of the next input token.
-// It must be followed by a call to endToken, once the token has
-// been consumed using readRune.
-func (in *input) startToken(sym *symType) {
- in.token = in.remaining
- sym.text = ""
- sym.pos = in.pos
-}
-
-// endToken marks the end of an input token.
-// It records the actual token string in sym.text if the caller
-// has not done that already.
-func (in *input) endToken(sym *symType) {
- if sym.text == "" {
- tok := string(in.token[:len(in.token)-len(in.remaining)])
- sym.text = tok
- in.lastToken = sym.text
- }
- sym.endPos = in.pos
-}
-
-// lex is called from the parser to obtain the next input token.
-// It returns the token value (either a rune like '+' or a symbolic token _FOR)
-// and sets val to the data associated with the token.
-// For all our input tokens, the associated data is
-// val.Pos (the position where the token begins)
-// and val.Token (the input string corresponding to the token).
-func (in *input) lex(sym *symType) int {
- // Skip past spaces, stopping at non-space or EOF.
- countNL := 0 // number of newlines we've skipped past
- for !in.eof() {
- // Skip over spaces. Count newlines so we can give the parser
- // information about where top-level blank lines are,
- // for top-level comment assignment.
- c := in.peekRune()
- if c == ' ' || c == '\t' || c == '\r' {
- in.readRune()
- continue
- }
-
- // Comment runs to end of line.
- if in.peekPrefix("//") {
- in.startToken(sym)
-
- // Is this comment the only thing on its line?
- // Find the last \n before this // and see if it's all
- // spaces from there to here.
- i := bytes.LastIndex(in.complete[:in.pos.Byte], []byte("\n"))
- suffix := len(bytes.TrimSpace(in.complete[i+1:in.pos.Byte])) > 0
- in.readRune()
- in.readRune()
-
- // Consume comment.
- for len(in.remaining) > 0 && in.readRune() != '\n' {
- }
- in.endToken(sym)
-
- sym.text = strings.TrimRight(sym.text, "\n")
- in.lastToken = "comment"
-
- // If we are at top level (not in a statement), hand the comment to
- // the parser as a _COMMENT token. The grammar is written
- // to handle top-level comments itself.
- if !suffix {
- // Not in a statement. Tell parser about top-level comment.
- return _COMMENT
- }
-
- // Otherwise, save comment for later attachment to syntax tree.
- if countNL > 1 {
- in.comments = append(in.comments, Comment{sym.pos, "", false})
- }
- in.comments = append(in.comments, Comment{sym.pos, sym.text, suffix})
- countNL = 1
- return _EOL
- }
-
- if in.peekPrefix("/*") {
- in.Error(fmt.Sprintf("mod files must use // comments (not /* */ comments)"))
- }
-
- // Found non-space non-comment.
- break
- }
-
- // Found the beginning of the next token.
- in.startToken(sym)
- defer in.endToken(sym)
-
- // End of file.
- if in.eof() {
- in.lastToken = "EOF"
- return _EOF
- }
-
- // Punctuation tokens.
- switch c := in.peekRune(); c {
- case '\n':
- in.readRune()
- return c
-
- case '(':
- in.readRune()
- return c
-
- case ')':
- in.readRune()
- return c
-
- case '"', '`': // quoted string
- quote := c
- in.readRune()
- for {
- if in.eof() {
- in.pos = sym.pos
- in.Error("unexpected EOF in string")
- }
- if in.peekRune() == '\n' {
- in.Error("unexpected newline in string")
- }
- c := in.readRune()
- if c == quote {
- break
- }
- if c == '\\' && quote != '`' {
- if in.eof() {
- in.pos = sym.pos
- in.Error("unexpected EOF in string")
- }
- in.readRune()
- }
- }
- in.endToken(sym)
- return _STRING
- }
-
- // Checked all punctuation. Must be identifier token.
- if c := in.peekRune(); !isIdent(c) {
- in.Error(fmt.Sprintf("unexpected input character %#q", c))
- }
-
- // Scan over identifier.
- for isIdent(in.peekRune()) {
- if in.peekPrefix("//") {
- break
- }
- if in.peekPrefix("/*") {
- in.Error(fmt.Sprintf("mod files must use // comments (not /* */ comments)"))
- }
- in.readRune()
- }
- return _IDENT
-}
-
-// isIdent reports whether c is an identifier rune.
-// We treat nearly all runes as identifier runes.
-func isIdent(c int) bool {
- return c != 0 && !unicode.IsSpace(rune(c))
-}
-
-// Comment assignment.
-// We build two lists of all subexpressions, preorder and postorder.
-// The preorder list is ordered by start location, with outer expressions first.
-// The postorder list is ordered by end location, with outer expressions last.
-// We use the preorder list to assign each whole-line comment to the syntax
-// immediately following it, and we use the postorder list to assign each
-// end-of-line comment to the syntax immediately preceding it.
-
-// order walks the expression adding it and its subexpressions to the
-// preorder and postorder lists.
-func (in *input) order(x Expr) {
- if x != nil {
- in.pre = append(in.pre, x)
- }
- switch x := x.(type) {
- default:
- panic(fmt.Errorf("order: unexpected type %T", x))
- case nil:
- // nothing
- case *LParen, *RParen:
- // nothing
- case *CommentBlock:
- // nothing
- case *Line:
- // nothing
- case *FileSyntax:
- for _, stmt := range x.Stmt {
- in.order(stmt)
- }
- case *LineBlock:
- in.order(&x.LParen)
- for _, l := range x.Line {
- in.order(l)
- }
- in.order(&x.RParen)
- }
- if x != nil {
- in.post = append(in.post, x)
- }
-}
-
-// assignComments attaches comments to nearby syntax.
-func (in *input) assignComments() {
- const debug = false
-
- // Generate preorder and postorder lists.
- in.order(in.file)
-
- // Split into whole-line comments and suffix comments.
- var line, suffix []Comment
- for _, com := range in.comments {
- if com.Suffix {
- suffix = append(suffix, com)
- } else {
- line = append(line, com)
- }
- }
-
- if debug {
- for _, c := range line {
- fmt.Fprintf(os.Stderr, "LINE %q :%d:%d #%d\n", c.Token, c.Start.Line, c.Start.LineRune, c.Start.Byte)
- }
- }
-
- // Assign line comments to syntax immediately following.
- for _, x := range in.pre {
- start, _ := x.Span()
- if debug {
- fmt.Printf("pre %T :%d:%d #%d\n", x, start.Line, start.LineRune, start.Byte)
- }
- xcom := x.Comment()
- for len(line) > 0 && start.Byte >= line[0].Start.Byte {
- if debug {
- fmt.Fprintf(os.Stderr, "ASSIGN LINE %q #%d\n", line[0].Token, line[0].Start.Byte)
- }
- xcom.Before = append(xcom.Before, line[0])
- line = line[1:]
- }
- }
-
- // Remaining line comments go at end of file.
- in.file.After = append(in.file.After, line...)
-
- if debug {
- for _, c := range suffix {
- fmt.Fprintf(os.Stderr, "SUFFIX %q :%d:%d #%d\n", c.Token, c.Start.Line, c.Start.LineRune, c.Start.Byte)
- }
- }
-
- // Assign suffix comments to syntax immediately before.
- for i := len(in.post) - 1; i >= 0; i-- {
- x := in.post[i]
-
- start, end := x.Span()
- if debug {
- fmt.Printf("post %T :%d:%d #%d :%d:%d #%d\n", x, start.Line, start.LineRune, start.Byte, end.Line, end.LineRune, end.Byte)
- }
-
- // Do not assign suffix comments to end of line block or whole file.
- // Instead assign them to the last element inside.
- switch x.(type) {
- case *FileSyntax:
- continue
- }
-
- // Do not assign suffix comments to something that starts
- // on an earlier line, so that in
- //
- // x ( y
- // z ) // comment
- //
- // we assign the comment to z and not to x ( ... ).
- if start.Line != end.Line {
- continue
- }
- xcom := x.Comment()
- for len(suffix) > 0 && end.Byte <= suffix[len(suffix)-1].Start.Byte {
- if debug {
- fmt.Fprintf(os.Stderr, "ASSIGN SUFFIX %q #%d\n", suffix[len(suffix)-1].Token, suffix[len(suffix)-1].Start.Byte)
- }
- xcom.Suffix = append(xcom.Suffix, suffix[len(suffix)-1])
- suffix = suffix[:len(suffix)-1]
- }
- }
-
- // We assigned suffix comments in reverse.
- // If multiple suffix comments were appended to the same
- // expression node, they are now in reverse. Fix that.
- for _, x := range in.post {
- reverseComments(x.Comment().Suffix)
- }
-
- // Remaining suffix comments go at beginning of file.
- in.file.Before = append(in.file.Before, suffix...)
-}
-
-// reverseComments reverses the []Comment list.
-func reverseComments(list []Comment) {
- for i, j := 0, len(list)-1; i < j; i, j = i+1, j-1 {
- list[i], list[j] = list[j], list[i]
- }
-}
-
-func (in *input) parseFile() {
- in.file = new(FileSyntax)
- var sym symType
- var cb *CommentBlock
- for {
- tok := in.lex(&sym)
- switch tok {
- case '\n':
- if cb != nil {
- in.file.Stmt = append(in.file.Stmt, cb)
- cb = nil
- }
- case _COMMENT:
- if cb == nil {
- cb = &CommentBlock{Start: sym.pos}
- }
- com := cb.Comment()
- com.Before = append(com.Before, Comment{Start: sym.pos, Token: sym.text})
- case _EOF:
- if cb != nil {
- in.file.Stmt = append(in.file.Stmt, cb)
- }
- return
- default:
- in.parseStmt(&sym)
- if cb != nil {
- in.file.Stmt[len(in.file.Stmt)-1].Comment().Before = cb.Before
- cb = nil
- }
- }
- }
-}
-
-func (in *input) parseStmt(sym *symType) {
- start := sym.pos
- end := sym.endPos
- token := []string{sym.text}
- for {
- tok := in.lex(sym)
- switch tok {
- case '\n', _EOF, _EOL:
- in.file.Stmt = append(in.file.Stmt, &Line{
- Start: start,
- Token: token,
- End: end,
- })
- return
- case '(':
- in.file.Stmt = append(in.file.Stmt, in.parseLineBlock(start, token, sym))
- return
- default:
- token = append(token, sym.text)
- end = sym.endPos
- }
- }
-}
-
-func (in *input) parseLineBlock(start Position, token []string, sym *symType) *LineBlock {
- x := &LineBlock{
- Start: start,
- Token: token,
- LParen: LParen{Pos: sym.pos},
- }
- var comments []Comment
- for {
- tok := in.lex(sym)
- switch tok {
- case _EOL:
- // ignore
- case '\n':
- if len(comments) == 0 && len(x.Line) > 0 || len(comments) > 0 && comments[len(comments)-1].Token != "" {
- comments = append(comments, Comment{})
- }
- case _COMMENT:
- comments = append(comments, Comment{Start: sym.pos, Token: sym.text})
- case _EOF:
- in.Error(fmt.Sprintf("syntax error (unterminated block started at %s:%d:%d)", in.filename, x.Start.Line, x.Start.LineRune))
- case ')':
- x.RParen.Before = comments
- x.RParen.Pos = sym.pos
- tok = in.lex(sym)
- if tok != '\n' && tok != _EOF && tok != _EOL {
- in.Error("syntax error (expected newline after closing paren)")
- }
- return x
- default:
- l := in.parseLine(sym)
- x.Line = append(x.Line, l)
- l.Comment().Before = comments
- comments = nil
- }
- }
-}
-
-func (in *input) parseLine(sym *symType) *Line {
- start := sym.pos
- end := sym.endPos
- token := []string{sym.text}
- for {
- tok := in.lex(sym)
- switch tok {
- case '\n', _EOF, _EOL:
- return &Line{
- Start: start,
- Token: token,
- End: end,
- InBlock: true,
- }
- default:
- token = append(token, sym.text)
- end = sym.endPos
- }
- }
-}
-
-const (
- _EOF = -(1 + iota)
- _EOL
- _IDENT
- _STRING
- _COMMENT
-)
-
-var (
- slashSlash = []byte("//")
- moduleStr = []byte("module")
-)
-
-// ModulePath returns the module path from the gomod file text.
-// If it cannot find a module path, it returns an empty string.
-// It is tolerant of unrelated problems in the go.mod file.
-func ModulePath(mod []byte) string {
- for len(mod) > 0 {
- line := mod
- mod = nil
- if i := bytes.IndexByte(line, '\n'); i >= 0 {
- line, mod = line[:i], line[i+1:]
- }
- if i := bytes.Index(line, slashSlash); i >= 0 {
- line = line[:i]
- }
- line = bytes.TrimSpace(line)
- if !bytes.HasPrefix(line, moduleStr) {
- continue
- }
- line = line[len(moduleStr):]
- n := len(line)
- line = bytes.TrimSpace(line)
- if len(line) == n || len(line) == 0 {
- continue
- }
-
- if line[0] == '"' || line[0] == '`' {
- p, err := strconv.Unquote(string(line))
- if err != nil {
- return "" // malformed quoted string or multiline module path
- }
- return p
- }
-
- return string(line)
- }
- return "" // missing module path
-}
diff --git a/libgo/go/cmd/go/internal/modfile/read_test.go b/libgo/go/cmd/go/internal/modfile/read_test.go
deleted file mode 100644
index 8cb1a3908c5..00000000000
--- a/libgo/go/cmd/go/internal/modfile/read_test.go
+++ /dev/null
@@ -1,365 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package modfile
-
-import (
- "bytes"
- "fmt"
- "io/ioutil"
- "os"
- "os/exec"
- "path/filepath"
- "reflect"
- "strings"
- "testing"
-)
-
-// exists reports whether the named file exists.
-func exists(name string) bool {
- _, err := os.Stat(name)
- return err == nil
-}
-
-// Test that reading and then writing the golden files
-// does not change their output.
-func TestPrintGolden(t *testing.T) {
- outs, err := filepath.Glob("testdata/*.golden")
- if err != nil {
- t.Fatal(err)
- }
- for _, out := range outs {
- testPrint(t, out, out)
- }
-}
-
-// testPrint is a helper for testing the printer.
-// It reads the file named in, reformats it, and compares
-// the result to the file named out.
-func testPrint(t *testing.T, in, out string) {
- data, err := ioutil.ReadFile(in)
- if err != nil {
- t.Error(err)
- return
- }
-
- golden, err := ioutil.ReadFile(out)
- if err != nil {
- t.Error(err)
- return
- }
-
- base := "testdata/" + filepath.Base(in)
- f, err := parse(in, data)
- if err != nil {
- t.Error(err)
- return
- }
-
- ndata := Format(f)
-
- if !bytes.Equal(ndata, golden) {
- t.Errorf("formatted %s incorrectly: diff shows -golden, +ours", base)
- tdiff(t, string(golden), string(ndata))
- return
- }
-}
-
-func TestParseLax(t *testing.T) {
- badFile := []byte(`module m
- surprise attack
- x y (
- z
- )
- exclude v1.2.3
- replace <-!!!
- `)
- _, err := ParseLax("file", badFile, nil)
- if err != nil {
- t.Fatalf("ParseLax did not ignore irrelevant errors: %v", err)
- }
-}
-
-// Test that when files in the testdata directory are parsed
-// and printed and parsed again, we get the same parse tree
-// both times.
-func TestPrintParse(t *testing.T) {
- outs, err := filepath.Glob("testdata/*")
- if err != nil {
- t.Fatal(err)
- }
- for _, out := range outs {
- data, err := ioutil.ReadFile(out)
- if err != nil {
- t.Error(err)
- continue
- }
-
- base := "testdata/" + filepath.Base(out)
- f, err := parse(base, data)
- if err != nil {
- t.Errorf("parsing original: %v", err)
- continue
- }
-
- ndata := Format(f)
- f2, err := parse(base, ndata)
- if err != nil {
- t.Errorf("parsing reformatted: %v", err)
- continue
- }
-
- eq := eqchecker{file: base}
- if err := eq.check(f, f2); err != nil {
- t.Errorf("not equal (parse/Format/parse): %v", err)
- }
-
- pf1, err := Parse(base, data, nil)
- if err != nil {
- switch base {
- case "testdata/replace2.in", "testdata/gopkg.in.golden":
- t.Errorf("should parse %v: %v", base, err)
- }
- }
- if err == nil {
- pf2, err := Parse(base, ndata, nil)
- if err != nil {
- t.Errorf("Parsing reformatted: %v", err)
- continue
- }
- eq := eqchecker{file: base}
- if err := eq.check(pf1, pf2); err != nil {
- t.Errorf("not equal (parse/Format/Parse): %v", err)
- }
-
- ndata2, err := pf1.Format()
- if err != nil {
- t.Errorf("reformat: %v", err)
- }
- pf3, err := Parse(base, ndata2, nil)
- if err != nil {
- t.Errorf("Parsing reformatted2: %v", err)
- continue
- }
- eq = eqchecker{file: base}
- if err := eq.check(pf1, pf3); err != nil {
- t.Errorf("not equal (Parse/Format/Parse): %v", err)
- }
- ndata = ndata2
- }
-
- if strings.HasSuffix(out, ".in") {
- golden, err := ioutil.ReadFile(strings.TrimSuffix(out, ".in") + ".golden")
- if err != nil {
- t.Error(err)
- continue
- }
- if !bytes.Equal(ndata, golden) {
- t.Errorf("formatted %s incorrectly: diff shows -golden, +ours", base)
- tdiff(t, string(golden), string(ndata))
- return
- }
- }
- }
-}
-
-// An eqchecker holds state for checking the equality of two parse trees.
-type eqchecker struct {
- file string
- pos Position
-}
-
-// errorf returns an error described by the printf-style format and arguments,
-// inserting the current file position before the error text.
-func (eq *eqchecker) errorf(format string, args ...interface{}) error {
- return fmt.Errorf("%s:%d: %s", eq.file, eq.pos.Line,
- fmt.Sprintf(format, args...))
-}
-
-// check checks that v and w represent the same parse tree.
-// If not, it returns an error describing the first difference.
-func (eq *eqchecker) check(v, w interface{}) error {
- return eq.checkValue(reflect.ValueOf(v), reflect.ValueOf(w))
-}
-
-var (
- posType = reflect.TypeOf(Position{})
- commentsType = reflect.TypeOf(Comments{})
-)
-
-// checkValue checks that v and w represent the same parse tree.
-// If not, it returns an error describing the first difference.
-func (eq *eqchecker) checkValue(v, w reflect.Value) error {
- // inner returns the innermost expression for v.
- // if v is a non-nil interface value, it returns the concrete
- // value in the interface.
- inner := func(v reflect.Value) reflect.Value {
- for {
- if v.Kind() == reflect.Interface && !v.IsNil() {
- v = v.Elem()
- continue
- }
- break
- }
- return v
- }
-
- v = inner(v)
- w = inner(w)
- if v.Kind() == reflect.Invalid && w.Kind() == reflect.Invalid {
- return nil
- }
- if v.Kind() == reflect.Invalid {
- return eq.errorf("nil interface became %s", w.Type())
- }
- if w.Kind() == reflect.Invalid {
- return eq.errorf("%s became nil interface", v.Type())
- }
-
- if v.Type() != w.Type() {
- return eq.errorf("%s became %s", v.Type(), w.Type())
- }
-
- if p, ok := v.Interface().(Expr); ok {
- eq.pos, _ = p.Span()
- }
-
- switch v.Kind() {
- default:
- return eq.errorf("unexpected type %s", v.Type())
-
- case reflect.Bool, reflect.Int, reflect.String:
- vi := v.Interface()
- wi := w.Interface()
- if vi != wi {
- return eq.errorf("%v became %v", vi, wi)
- }
-
- case reflect.Slice:
- vl := v.Len()
- wl := w.Len()
- for i := 0; i < vl || i < wl; i++ {
- if i >= vl {
- return eq.errorf("unexpected %s", w.Index(i).Type())
- }
- if i >= wl {
- return eq.errorf("missing %s", v.Index(i).Type())
- }
- if err := eq.checkValue(v.Index(i), w.Index(i)); err != nil {
- return err
- }
- }
-
- case reflect.Struct:
- // Fields in struct must match.
- t := v.Type()
- n := t.NumField()
- for i := 0; i < n; i++ {
- tf := t.Field(i)
- switch {
- default:
- if err := eq.checkValue(v.Field(i), w.Field(i)); err != nil {
- return err
- }
-
- case tf.Type == posType: // ignore positions
- case tf.Type == commentsType: // ignore comment assignment
- }
- }
-
- case reflect.Ptr, reflect.Interface:
- if v.IsNil() != w.IsNil() {
- if v.IsNil() {
- return eq.errorf("unexpected %s", w.Elem().Type())
- }
- return eq.errorf("missing %s", v.Elem().Type())
- }
- if err := eq.checkValue(v.Elem(), w.Elem()); err != nil {
- return err
- }
- }
- return nil
-}
-
-// diff returns the output of running diff on b1 and b2.
-func diff(b1, b2 []byte) (data []byte, err error) {
- f1, err := ioutil.TempFile("", "testdiff")
- if err != nil {
- return nil, err
- }
- defer os.Remove(f1.Name())
- defer f1.Close()
-
- f2, err := ioutil.TempFile("", "testdiff")
- if err != nil {
- return nil, err
- }
- defer os.Remove(f2.Name())
- defer f2.Close()
-
- f1.Write(b1)
- f2.Write(b2)
-
- data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOutput()
- if len(data) > 0 {
- // diff exits with a non-zero status when the files don't match.
- // Ignore that failure as long as we get output.
- err = nil
- }
- return
-}
-
-// tdiff logs the diff output to t.Error.
-func tdiff(t *testing.T, a, b string) {
- data, err := diff([]byte(a), []byte(b))
- if err != nil {
- t.Error(err)
- return
- }
- t.Error(string(data))
-}
-
-var modulePathTests = []struct {
- input []byte
- expected string
-}{
- {input: []byte("module \"github.com/rsc/vgotest\""), expected: "github.com/rsc/vgotest"},
- {input: []byte("module github.com/rsc/vgotest"), expected: "github.com/rsc/vgotest"},
- {input: []byte("module \"github.com/rsc/vgotest\""), expected: "github.com/rsc/vgotest"},
- {input: []byte("module github.com/rsc/vgotest"), expected: "github.com/rsc/vgotest"},
- {input: []byte("module `github.com/rsc/vgotest`"), expected: "github.com/rsc/vgotest"},
- {input: []byte("module \"github.com/rsc/vgotest/v2\""), expected: "github.com/rsc/vgotest/v2"},
- {input: []byte("module github.com/rsc/vgotest/v2"), expected: "github.com/rsc/vgotest/v2"},
- {input: []byte("module \"gopkg.in/yaml.v2\""), expected: "gopkg.in/yaml.v2"},
- {input: []byte("module gopkg.in/yaml.v2"), expected: "gopkg.in/yaml.v2"},
- {input: []byte("module \"gopkg.in/check.v1\"\n"), expected: "gopkg.in/check.v1"},
- {input: []byte("module \"gopkg.in/check.v1\n\""), expected: ""},
- {input: []byte("module gopkg.in/check.v1\n"), expected: "gopkg.in/check.v1"},
- {input: []byte("module \"gopkg.in/check.v1\"\r\n"), expected: "gopkg.in/check.v1"},
- {input: []byte("module gopkg.in/check.v1\r\n"), expected: "gopkg.in/check.v1"},
- {input: []byte("module \"gopkg.in/check.v1\"\n\n"), expected: "gopkg.in/check.v1"},
- {input: []byte("module gopkg.in/check.v1\n\n"), expected: "gopkg.in/check.v1"},
- {input: []byte("module \n\"gopkg.in/check.v1\"\n\n"), expected: ""},
- {input: []byte("module \ngopkg.in/check.v1\n\n"), expected: ""},
- {input: []byte("module \"gopkg.in/check.v1\"asd"), expected: ""},
- {input: []byte("module \n\"gopkg.in/check.v1\"\n\n"), expected: ""},
- {input: []byte("module \ngopkg.in/check.v1\n\n"), expected: ""},
- {input: []byte("module \"gopkg.in/check.v1\"asd"), expected: ""},
- {input: []byte("module \nmodule a/b/c "), expected: "a/b/c"},
- {input: []byte("module \" \""), expected: " "},
- {input: []byte("module "), expected: ""},
- {input: []byte("module \" a/b/c \""), expected: " a/b/c "},
- {input: []byte("module \"github.com/rsc/vgotest1\" // with a comment"), expected: "github.com/rsc/vgotest1"},
-}
-
-func TestModulePath(t *testing.T) {
- for _, test := range modulePathTests {
- t.Run(string(test.input), func(t *testing.T) {
- result := ModulePath(test.input)
- if result != test.expected {
- t.Fatalf("ModulePath(%q): %s, want %s", string(test.input), result, test.expected)
- }
- })
- }
-}
diff --git a/libgo/go/cmd/go/internal/modfile/rule.go b/libgo/go/cmd/go/internal/modfile/rule.go
deleted file mode 100644
index 6e1a22f3caa..00000000000
--- a/libgo/go/cmd/go/internal/modfile/rule.go
+++ /dev/null
@@ -1,763 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package modfile
-
-import (
- "bytes"
- "errors"
- "fmt"
- "internal/lazyregexp"
- "path/filepath"
- "sort"
- "strconv"
- "strings"
- "unicode"
-
- "cmd/go/internal/module"
-)
-
-// A File is the parsed, interpreted form of a go.mod file.
-type File struct {
- Module *Module
- Go *Go
- Require []*Require
- Exclude []*Exclude
- Replace []*Replace
-
- Syntax *FileSyntax
-}
-
-// A Module is the module statement.
-type Module struct {
- Mod module.Version
- Syntax *Line
-}
-
-// A Go is the go statement.
-type Go struct {
- Version string // "1.23"
- Syntax *Line
-}
-
-// A Require is a single require statement.
-type Require struct {
- Mod module.Version
- Indirect bool // has "// indirect" comment
- Syntax *Line
-}
-
-// An Exclude is a single exclude statement.
-type Exclude struct {
- Mod module.Version
- Syntax *Line
-}
-
-// A Replace is a single replace statement.
-type Replace struct {
- Old module.Version
- New module.Version
- Syntax *Line
-}
-
-func (f *File) AddModuleStmt(path string) error {
- if f.Syntax == nil {
- f.Syntax = new(FileSyntax)
- }
- if f.Module == nil {
- f.Module = &Module{
- Mod: module.Version{Path: path},
- Syntax: f.Syntax.addLine(nil, "module", AutoQuote(path)),
- }
- } else {
- f.Module.Mod.Path = path
- f.Syntax.updateLine(f.Module.Syntax, "module", AutoQuote(path))
- }
- return nil
-}
-
-func (f *File) AddComment(text string) {
- if f.Syntax == nil {
- f.Syntax = new(FileSyntax)
- }
- f.Syntax.Stmt = append(f.Syntax.Stmt, &CommentBlock{
- Comments: Comments{
- Before: []Comment{
- {
- Token: text,
- },
- },
- },
- })
-}
-
-type VersionFixer func(path, version string) (string, error)
-
-// Parse parses the data, reported in errors as being from file,
-// into a File struct. It applies fix, if non-nil, to canonicalize all module versions found.
-func Parse(file string, data []byte, fix VersionFixer) (*File, error) {
- return parseToFile(file, data, fix, true)
-}
-
-// ParseLax is like Parse but ignores unknown statements.
-// It is used when parsing go.mod files other than the main module,
-// under the theory that most statement types we add in the future will
-// only apply in the main module, like exclude and replace,
-// and so we get better gradual deployments if old go commands
-// simply ignore those statements when found in go.mod files
-// in dependencies.
-func ParseLax(file string, data []byte, fix VersionFixer) (*File, error) {
- return parseToFile(file, data, fix, false)
-}
-
-func parseToFile(file string, data []byte, fix VersionFixer, strict bool) (*File, error) {
- fs, err := parse(file, data)
- if err != nil {
- return nil, err
- }
- f := &File{
- Syntax: fs,
- }
-
- var errs bytes.Buffer
- for _, x := range fs.Stmt {
- switch x := x.(type) {
- case *Line:
- f.add(&errs, x, x.Token[0], x.Token[1:], fix, strict)
-
- case *LineBlock:
- if len(x.Token) > 1 {
- if strict {
- fmt.Fprintf(&errs, "%s:%d: unknown block type: %s\n", file, x.Start.Line, strings.Join(x.Token, " "))
- }
- continue
- }
- switch x.Token[0] {
- default:
- if strict {
- fmt.Fprintf(&errs, "%s:%d: unknown block type: %s\n", file, x.Start.Line, strings.Join(x.Token, " "))
- }
- continue
- case "module", "require", "exclude", "replace":
- for _, l := range x.Line {
- f.add(&errs, l, x.Token[0], l.Token, fix, strict)
- }
- }
- }
- }
-
- if errs.Len() > 0 {
- return nil, errors.New(strings.TrimRight(errs.String(), "\n"))
- }
- return f, nil
-}
-
-var GoVersionRE = lazyregexp.New(`([1-9][0-9]*)\.(0|[1-9][0-9]*)`)
-
-func (f *File) add(errs *bytes.Buffer, line *Line, verb string, args []string, fix VersionFixer, strict bool) {
- // If strict is false, this module is a dependency.
- // We ignore all unknown directives as well as main-module-only
- // directives like replace and exclude. It will work better for
- // forward compatibility if we can depend on modules that have unknown
- // statements (presumed relevant only when acting as the main module)
- // and simply ignore those statements.
- if !strict {
- switch verb {
- case "module", "require", "go":
- // want these even for dependency go.mods
- default:
- return
- }
- }
-
- switch verb {
- default:
- fmt.Fprintf(errs, "%s:%d: unknown directive: %s\n", f.Syntax.Name, line.Start.Line, verb)
-
- case "go":
- if f.Go != nil {
- fmt.Fprintf(errs, "%s:%d: repeated go statement\n", f.Syntax.Name, line.Start.Line)
- return
- }
- if len(args) != 1 || !GoVersionRE.MatchString(args[0]) {
- fmt.Fprintf(errs, "%s:%d: usage: go 1.23\n", f.Syntax.Name, line.Start.Line)
- return
- }
- f.Go = &Go{Syntax: line}
- f.Go.Version = args[0]
- case "module":
- if f.Module != nil {
- fmt.Fprintf(errs, "%s:%d: repeated module statement\n", f.Syntax.Name, line.Start.Line)
- return
- }
- f.Module = &Module{Syntax: line}
- if len(args) != 1 {
-
- fmt.Fprintf(errs, "%s:%d: usage: module module/path\n", f.Syntax.Name, line.Start.Line)
- return
- }
- s, err := parseString(&args[0])
- if err != nil {
- fmt.Fprintf(errs, "%s:%d: invalid quoted string: %v\n", f.Syntax.Name, line.Start.Line, err)
- return
- }
- f.Module.Mod = module.Version{Path: s}
- case "require", "exclude":
- if len(args) != 2 {
- fmt.Fprintf(errs, "%s:%d: usage: %s module/path v1.2.3\n", f.Syntax.Name, line.Start.Line, verb)
- return
- }
- s, err := parseString(&args[0])
- if err != nil {
- fmt.Fprintf(errs, "%s:%d: invalid quoted string: %v\n", f.Syntax.Name, line.Start.Line, err)
- return
- }
- v, err := parseVersion(verb, s, &args[1], fix)
- if err != nil {
- fmt.Fprintf(errs, "%s:%d: %v\n", f.Syntax.Name, line.Start.Line, err)
- return
- }
- pathMajor, err := modulePathMajor(s)
- if err != nil {
- fmt.Fprintf(errs, "%s:%d: %v\n", f.Syntax.Name, line.Start.Line, err)
- return
- }
- if err := module.MatchPathMajor(v, pathMajor); err != nil {
- fmt.Fprintf(errs, "%s:%d: %v\n", f.Syntax.Name, line.Start.Line, &Error{Verb: verb, ModPath: s, Err: err})
- return
- }
- if verb == "require" {
- f.Require = append(f.Require, &Require{
- Mod: module.Version{Path: s, Version: v},
- Syntax: line,
- Indirect: isIndirect(line),
- })
- } else {
- f.Exclude = append(f.Exclude, &Exclude{
- Mod: module.Version{Path: s, Version: v},
- Syntax: line,
- })
- }
- case "replace":
- arrow := 2
- if len(args) >= 2 && args[1] == "=>" {
- arrow = 1
- }
- if len(args) < arrow+2 || len(args) > arrow+3 || args[arrow] != "=>" {
- fmt.Fprintf(errs, "%s:%d: usage: %s module/path [v1.2.3] => other/module v1.4\n\t or %s module/path [v1.2.3] => ../local/directory\n", f.Syntax.Name, line.Start.Line, verb, verb)
- return
- }
- s, err := parseString(&args[0])
- if err != nil {
- fmt.Fprintf(errs, "%s:%d: invalid quoted string: %v\n", f.Syntax.Name, line.Start.Line, err)
- return
- }
- pathMajor, err := modulePathMajor(s)
- if err != nil {
- fmt.Fprintf(errs, "%s:%d: %v\n", f.Syntax.Name, line.Start.Line, err)
- return
- }
- var v string
- if arrow == 2 {
- v, err = parseVersion(verb, s, &args[1], fix)
- if err != nil {
- fmt.Fprintf(errs, "%s:%d: %v\n", f.Syntax.Name, line.Start.Line, err)
- return
- }
- if err := module.MatchPathMajor(v, pathMajor); err != nil {
- fmt.Fprintf(errs, "%s:%d: %v\n", f.Syntax.Name, line.Start.Line, &Error{Verb: verb, ModPath: s, Err: err})
- return
- }
- }
- ns, err := parseString(&args[arrow+1])
- if err != nil {
- fmt.Fprintf(errs, "%s:%d: invalid quoted string: %v\n", f.Syntax.Name, line.Start.Line, err)
- return
- }
- nv := ""
- if len(args) == arrow+2 {
- if !IsDirectoryPath(ns) {
- fmt.Fprintf(errs, "%s:%d: replacement module without version must be directory path (rooted or starting with ./ or ../)\n", f.Syntax.Name, line.Start.Line)
- return
- }
- if filepath.Separator == '/' && strings.Contains(ns, `\`) {
- fmt.Fprintf(errs, "%s:%d: replacement directory appears to be Windows path (on a non-windows system)\n", f.Syntax.Name, line.Start.Line)
- return
- }
- }
- if len(args) == arrow+3 {
- nv, err = parseVersion(verb, ns, &args[arrow+2], fix)
- if err != nil {
- fmt.Fprintf(errs, "%s:%d: %v\n", f.Syntax.Name, line.Start.Line, err)
- return
- }
- if IsDirectoryPath(ns) {
- fmt.Fprintf(errs, "%s:%d: replacement module directory path %q cannot have version\n", f.Syntax.Name, line.Start.Line, ns)
- return
- }
- }
- f.Replace = append(f.Replace, &Replace{
- Old: module.Version{Path: s, Version: v},
- New: module.Version{Path: ns, Version: nv},
- Syntax: line,
- })
- }
-}
-
-// isIndirect reports whether line has a "// indirect" comment,
-// meaning it is in go.mod only for its effect on indirect dependencies,
-// so that it can be dropped entirely once the effective version of the
-// indirect dependency reaches the given minimum version.
-func isIndirect(line *Line) bool {
- if len(line.Suffix) == 0 {
- return false
- }
- f := strings.Fields(line.Suffix[0].Token)
- return (len(f) == 2 && f[1] == "indirect" || len(f) > 2 && f[1] == "indirect;") && f[0] == "//"
-}
-
-// setIndirect sets line to have (or not have) a "// indirect" comment.
-func setIndirect(line *Line, indirect bool) {
- if isIndirect(line) == indirect {
- return
- }
- if indirect {
- // Adding comment.
- if len(line.Suffix) == 0 {
- // New comment.
- line.Suffix = []Comment{{Token: "// indirect", Suffix: true}}
- return
- }
- // Insert at beginning of existing comment.
- com := &line.Suffix[0]
- space := " "
- if len(com.Token) > 2 && com.Token[2] == ' ' || com.Token[2] == '\t' {
- space = ""
- }
- com.Token = "// indirect;" + space + com.Token[2:]
- return
- }
-
- // Removing comment.
- f := strings.Fields(line.Suffix[0].Token)
- if len(f) == 2 {
- // Remove whole comment.
- line.Suffix = nil
- return
- }
-
- // Remove comment prefix.
- com := &line.Suffix[0]
- i := strings.Index(com.Token, "indirect;")
- com.Token = "//" + com.Token[i+len("indirect;"):]
-}
-
-// IsDirectoryPath reports whether the given path should be interpreted
-// as a directory path. Just like on the go command line, relative paths
-// and rooted paths are directory paths; the rest are module paths.
-func IsDirectoryPath(ns string) bool {
- // Because go.mod files can move from one system to another,
- // we check all known path syntaxes, both Unix and Windows.
- return strings.HasPrefix(ns, "./") || strings.HasPrefix(ns, "../") || strings.HasPrefix(ns, "/") ||
- strings.HasPrefix(ns, `.\`) || strings.HasPrefix(ns, `..\`) || strings.HasPrefix(ns, `\`) ||
- len(ns) >= 2 && ('A' <= ns[0] && ns[0] <= 'Z' || 'a' <= ns[0] && ns[0] <= 'z') && ns[1] == ':'
-}
-
-// MustQuote reports whether s must be quoted in order to appear as
-// a single token in a go.mod line.
-func MustQuote(s string) bool {
- for _, r := range s {
- if !unicode.IsPrint(r) || r == ' ' || r == '"' || r == '\'' || r == '`' {
- return true
- }
- }
- return s == "" || strings.Contains(s, "//") || strings.Contains(s, "/*")
-}
-
-// AutoQuote returns s or, if quoting is required for s to appear in a go.mod,
-// the quotation of s.
-func AutoQuote(s string) string {
- if MustQuote(s) {
- return strconv.Quote(s)
- }
- return s
-}
-
-func parseString(s *string) (string, error) {
- t := *s
- if strings.HasPrefix(t, `"`) {
- var err error
- if t, err = strconv.Unquote(t); err != nil {
- return "", err
- }
- } else if strings.ContainsAny(t, "\"'`") {
- // Other quotes are reserved both for possible future expansion
- // and to avoid confusion. For example if someone types 'x'
- // we want that to be a syntax error and not a literal x in literal quotation marks.
- return "", fmt.Errorf("unquoted string cannot contain quote")
- }
- *s = AutoQuote(t)
- return t, nil
-}
-
-type Error struct {
- Verb string
- ModPath string
- Err error
-}
-
-func (e *Error) Error() string {
- return fmt.Sprintf("%s %s: %v", e.Verb, e.ModPath, e.Err)
-}
-
-func (e *Error) Unwrap() error { return e.Err }
-
-func parseVersion(verb string, path string, s *string, fix VersionFixer) (string, error) {
- t, err := parseString(s)
- if err != nil {
- return "", &Error{
- Verb: verb,
- ModPath: path,
- Err: &module.InvalidVersionError{
- Version: *s,
- Err: err,
- },
- }
- }
- if fix != nil {
- var err error
- t, err = fix(path, t)
- if err != nil {
- if err, ok := err.(*module.ModuleError); ok {
- return "", &Error{
- Verb: verb,
- ModPath: path,
- Err: err.Err,
- }
- }
- return "", err
- }
- }
- if v := module.CanonicalVersion(t); v != "" {
- *s = v
- return *s, nil
- }
- return "", &Error{
- Verb: verb,
- ModPath: path,
- Err: &module.InvalidVersionError{
- Version: t,
- Err: errors.New("must be of the form v1.2.3"),
- },
- }
-}
-
-func modulePathMajor(path string) (string, error) {
- _, major, ok := module.SplitPathVersion(path)
- if !ok {
- return "", fmt.Errorf("invalid module path")
- }
- return major, nil
-}
-
-func (f *File) Format() ([]byte, error) {
- return Format(f.Syntax), nil
-}
-
-// Cleanup cleans up the file f after any edit operations.
-// To avoid quadratic behavior, modifications like DropRequire
-// clear the entry but do not remove it from the slice.
-// Cleanup cleans out all the cleared entries.
-func (f *File) Cleanup() {
- w := 0
- for _, r := range f.Require {
- if r.Mod.Path != "" {
- f.Require[w] = r
- w++
- }
- }
- f.Require = f.Require[:w]
-
- w = 0
- for _, x := range f.Exclude {
- if x.Mod.Path != "" {
- f.Exclude[w] = x
- w++
- }
- }
- f.Exclude = f.Exclude[:w]
-
- w = 0
- for _, r := range f.Replace {
- if r.Old.Path != "" {
- f.Replace[w] = r
- w++
- }
- }
- f.Replace = f.Replace[:w]
-
- f.Syntax.Cleanup()
-}
-
-func (f *File) AddGoStmt(version string) error {
- if !GoVersionRE.MatchString(version) {
- return fmt.Errorf("invalid language version string %q", version)
- }
- if f.Go == nil {
- f.Go = &Go{
- Version: version,
- Syntax: f.Syntax.addLine(nil, "go", version),
- }
- } else {
- f.Go.Version = version
- f.Syntax.updateLine(f.Go.Syntax, "go", version)
- }
- return nil
-}
-
-func (f *File) AddRequire(path, vers string) error {
- need := true
- for _, r := range f.Require {
- if r.Mod.Path == path {
- if need {
- r.Mod.Version = vers
- f.Syntax.updateLine(r.Syntax, "require", AutoQuote(path), vers)
- need = false
- } else {
- f.Syntax.removeLine(r.Syntax)
- *r = Require{}
- }
- }
- }
-
- if need {
- f.AddNewRequire(path, vers, false)
- }
- return nil
-}
-
-func (f *File) AddNewRequire(path, vers string, indirect bool) {
- line := f.Syntax.addLine(nil, "require", AutoQuote(path), vers)
- setIndirect(line, indirect)
- f.Require = append(f.Require, &Require{module.Version{Path: path, Version: vers}, indirect, line})
-}
-
-func (f *File) SetRequire(req []*Require) {
- need := make(map[string]string)
- indirect := make(map[string]bool)
- for _, r := range req {
- need[r.Mod.Path] = r.Mod.Version
- indirect[r.Mod.Path] = r.Indirect
- }
-
- for _, r := range f.Require {
- if v, ok := need[r.Mod.Path]; ok {
- r.Mod.Version = v
- r.Indirect = indirect[r.Mod.Path]
- }
- }
-
- var newStmts []Expr
- for _, stmt := range f.Syntax.Stmt {
- switch stmt := stmt.(type) {
- case *LineBlock:
- if len(stmt.Token) > 0 && stmt.Token[0] == "require" {
- var newLines []*Line
- for _, line := range stmt.Line {
- if p, err := parseString(&line.Token[0]); err == nil && need[p] != "" {
- line.Token[1] = need[p]
- delete(need, p)
- setIndirect(line, indirect[p])
- newLines = append(newLines, line)
- }
- }
- if len(newLines) == 0 {
- continue // drop stmt
- }
- stmt.Line = newLines
- }
-
- case *Line:
- if len(stmt.Token) > 0 && stmt.Token[0] == "require" {
- if p, err := parseString(&stmt.Token[1]); err == nil && need[p] != "" {
- stmt.Token[2] = need[p]
- delete(need, p)
- setIndirect(stmt, indirect[p])
- } else {
- continue // drop stmt
- }
- }
- }
- newStmts = append(newStmts, stmt)
- }
- f.Syntax.Stmt = newStmts
-
- for path, vers := range need {
- f.AddNewRequire(path, vers, indirect[path])
- }
- f.SortBlocks()
-}
-
-func (f *File) DropRequire(path string) error {
- for _, r := range f.Require {
- if r.Mod.Path == path {
- f.Syntax.removeLine(r.Syntax)
- *r = Require{}
- }
- }
- return nil
-}
-
-func (f *File) AddExclude(path, vers string) error {
- var hint *Line
- for _, x := range f.Exclude {
- if x.Mod.Path == path && x.Mod.Version == vers {
- return nil
- }
- if x.Mod.Path == path {
- hint = x.Syntax
- }
- }
-
- f.Exclude = append(f.Exclude, &Exclude{Mod: module.Version{Path: path, Version: vers}, Syntax: f.Syntax.addLine(hint, "exclude", AutoQuote(path), vers)})
- return nil
-}
-
-func (f *File) DropExclude(path, vers string) error {
- for _, x := range f.Exclude {
- if x.Mod.Path == path && x.Mod.Version == vers {
- f.Syntax.removeLine(x.Syntax)
- *x = Exclude{}
- }
- }
- return nil
-}
-
-func (f *File) AddReplace(oldPath, oldVers, newPath, newVers string) error {
- need := true
- old := module.Version{Path: oldPath, Version: oldVers}
- new := module.Version{Path: newPath, Version: newVers}
- tokens := []string{"replace", AutoQuote(oldPath)}
- if oldVers != "" {
- tokens = append(tokens, oldVers)
- }
- tokens = append(tokens, "=>", AutoQuote(newPath))
- if newVers != "" {
- tokens = append(tokens, newVers)
- }
-
- var hint *Line
- for _, r := range f.Replace {
- if r.Old.Path == oldPath && (oldVers == "" || r.Old.Version == oldVers) {
- if need {
- // Found replacement for old; update to use new.
- r.New = new
- f.Syntax.updateLine(r.Syntax, tokens...)
- need = false
- continue
- }
- // Already added; delete other replacements for same.
- f.Syntax.removeLine(r.Syntax)
- *r = Replace{}
- }
- if r.Old.Path == oldPath {
- hint = r.Syntax
- }
- }
- if need {
- f.Replace = append(f.Replace, &Replace{Old: old, New: new, Syntax: f.Syntax.addLine(hint, tokens...)})
- }
- return nil
-}
-
-func (f *File) DropReplace(oldPath, oldVers string) error {
- for _, r := range f.Replace {
- if r.Old.Path == oldPath && r.Old.Version == oldVers {
- f.Syntax.removeLine(r.Syntax)
- *r = Replace{}
- }
- }
- return nil
-}
-
-func (f *File) SortBlocks() {
- f.removeDups() // otherwise sorting is unsafe
-
- for _, stmt := range f.Syntax.Stmt {
- block, ok := stmt.(*LineBlock)
- if !ok {
- continue
- }
- sort.Slice(block.Line, func(i, j int) bool {
- li := block.Line[i]
- lj := block.Line[j]
- for k := 0; k < len(li.Token) && k < len(lj.Token); k++ {
- if li.Token[k] != lj.Token[k] {
- return li.Token[k] < lj.Token[k]
- }
- }
- return len(li.Token) < len(lj.Token)
- })
- }
-}
-
-func (f *File) removeDups() {
- have := make(map[module.Version]bool)
- kill := make(map[*Line]bool)
- for _, x := range f.Exclude {
- if have[x.Mod] {
- kill[x.Syntax] = true
- continue
- }
- have[x.Mod] = true
- }
- var excl []*Exclude
- for _, x := range f.Exclude {
- if !kill[x.Syntax] {
- excl = append(excl, x)
- }
- }
- f.Exclude = excl
-
- have = make(map[module.Version]bool)
- // Later replacements take priority over earlier ones.
- for i := len(f.Replace) - 1; i >= 0; i-- {
- x := f.Replace[i]
- if have[x.Old] {
- kill[x.Syntax] = true
- continue
- }
- have[x.Old] = true
- }
- var repl []*Replace
- for _, x := range f.Replace {
- if !kill[x.Syntax] {
- repl = append(repl, x)
- }
- }
- f.Replace = repl
-
- var stmts []Expr
- for _, stmt := range f.Syntax.Stmt {
- switch stmt := stmt.(type) {
- case *Line:
- if kill[stmt] {
- continue
- }
- case *LineBlock:
- var lines []*Line
- for _, line := range stmt.Line {
- if !kill[line] {
- lines = append(lines, line)
- }
- }
- stmt.Line = lines
- if len(lines) == 0 {
- continue
- }
- }
- stmts = append(stmts, stmt)
- }
- f.Syntax.Stmt = stmts
-}
diff --git a/libgo/go/cmd/go/internal/modfile/rule_test.go b/libgo/go/cmd/go/internal/modfile/rule_test.go
deleted file mode 100644
index b88ad629168..00000000000
--- a/libgo/go/cmd/go/internal/modfile/rule_test.go
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package modfile
-
-import (
- "bytes"
- "fmt"
- "testing"
-)
-
-var addRequireTests = []struct {
- in string
- path string
- vers string
- out string
-}{
- {
- `
- module m
- require x.y/z v1.2.3
- `,
- "x.y/z", "v1.5.6",
- `
- module m
- require x.y/z v1.5.6
- `,
- },
- {
- `
- module m
- require x.y/z v1.2.3
- `,
- "x.y/w", "v1.5.6",
- `
- module m
- require (
- x.y/z v1.2.3
- x.y/w v1.5.6
- )
- `,
- },
- {
- `
- module m
- require x.y/z v1.2.3
- require x.y/q/v2 v2.3.4
- `,
- "x.y/w", "v1.5.6",
- `
- module m
- require x.y/z v1.2.3
- require (
- x.y/q/v2 v2.3.4
- x.y/w v1.5.6
- )
- `,
- },
-}
-
-func TestAddRequire(t *testing.T) {
- for i, tt := range addRequireTests {
- t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) {
- f, err := Parse("in", []byte(tt.in), nil)
- if err != nil {
- t.Fatal(err)
- }
- g, err := Parse("out", []byte(tt.out), nil)
- if err != nil {
- t.Fatal(err)
- }
- golden, err := g.Format()
- if err != nil {
- t.Fatal(err)
- }
-
- if err := f.AddRequire(tt.path, tt.vers); err != nil {
- t.Fatal(err)
- }
- out, err := f.Format()
- if err != nil {
- t.Fatal(err)
- }
- if !bytes.Equal(out, golden) {
- t.Errorf("have:\n%s\nwant:\n%s", out, golden)
- }
- })
- }
-}
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/block.golden b/libgo/go/cmd/go/internal/modfile/testdata/block.golden
deleted file mode 100644
index 4aa2d634fc9..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/block.golden
+++ /dev/null
@@ -1,29 +0,0 @@
-// comment
-x "y" z
-
-// block
-block ( // block-eol
- // x-before-line
-
- "x" ( y // x-eol
- "x1"
- "x2"
- // line
- "x3"
- "x4"
-
- "x5"
-
- // y-line
- "y" // y-eol
-
- "z" // z-eol
-) // block-eol2
-
-block2 (
- x
- y
- z
-)
-
-// eof
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/block.in b/libgo/go/cmd/go/internal/modfile/testdata/block.in
deleted file mode 100644
index 1dfae65f5c0..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/block.in
+++ /dev/null
@@ -1,29 +0,0 @@
-// comment
-x "y" z
-
-// block
-block ( // block-eol
- // x-before-line
-
- "x" ( y // x-eol
- "x1"
- "x2"
- // line
- "x3"
- "x4"
-
- "x5"
-
- // y-line
- "y" // y-eol
-
- "z" // z-eol
-) // block-eol2
-
-
-block2 (x
- y
- z
-)
-
-// eof
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/comment.golden b/libgo/go/cmd/go/internal/modfile/testdata/comment.golden
deleted file mode 100644
index 75f3b84478c..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/comment.golden
+++ /dev/null
@@ -1,10 +0,0 @@
-// comment
-module "x" // eol
-
-// mid comment
-
-// comment 2
-// comment 2 line 2
-module "y" // eoy
-
-// comment 3
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/comment.in b/libgo/go/cmd/go/internal/modfile/testdata/comment.in
deleted file mode 100644
index bfc2492b264..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/comment.in
+++ /dev/null
@@ -1,8 +0,0 @@
-// comment
-module "x" // eol
-// mid comment
-
-// comment 2
-// comment 2 line 2
-module "y" // eoy
-// comment 3
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/empty.golden b/libgo/go/cmd/go/internal/modfile/testdata/empty.golden
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/empty.golden
+++ /dev/null
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/empty.in b/libgo/go/cmd/go/internal/modfile/testdata/empty.in
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/empty.in
+++ /dev/null
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/gopkg.in.golden b/libgo/go/cmd/go/internal/modfile/testdata/gopkg.in.golden
deleted file mode 100644
index 41669b3a737..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/gopkg.in.golden
+++ /dev/null
@@ -1,6 +0,0 @@
-module x
-
-require (
- gopkg.in/mgo.v2 v2.0.0-20160818020120-3f83fa500528
- gopkg.in/yaml.v2 v2.2.1
-)
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/module.golden b/libgo/go/cmd/go/internal/modfile/testdata/module.golden
deleted file mode 100644
index 78ba94398c3..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/module.golden
+++ /dev/null
@@ -1 +0,0 @@
-module abc
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/module.in b/libgo/go/cmd/go/internal/modfile/testdata/module.in
deleted file mode 100644
index 08f383623f9..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/module.in
+++ /dev/null
@@ -1 +0,0 @@
-module "abc"
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/replace.golden b/libgo/go/cmd/go/internal/modfile/testdata/replace.golden
deleted file mode 100644
index 5d6abcfcdad..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/replace.golden
+++ /dev/null
@@ -1,5 +0,0 @@
-module abc
-
-replace xyz v1.2.3 => /tmp/z
-
-replace xyz v1.3.4 => my/xyz v1.3.4-me
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/replace.in b/libgo/go/cmd/go/internal/modfile/testdata/replace.in
deleted file mode 100644
index 685249946a2..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/replace.in
+++ /dev/null
@@ -1,5 +0,0 @@
-module "abc"
-
-replace "xyz" v1.2.3 => "/tmp/z"
-
-replace "xyz" v1.3.4 => "my/xyz" v1.3.4-me
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/replace2.golden b/libgo/go/cmd/go/internal/modfile/testdata/replace2.golden
deleted file mode 100644
index e1d9c728df4..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/replace2.golden
+++ /dev/null
@@ -1,10 +0,0 @@
-module abc
-
-replace (
- xyz v1.2.3 => /tmp/z
- xyz v1.3.4 => my/xyz v1.3.4-me
- xyz v1.4.5 => "/tmp/my dir"
- xyz v1.5.6 => my/xyz v1.5.6
-
- xyz => my/other/xyz v1.5.4
-)
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/replace2.in b/libgo/go/cmd/go/internal/modfile/testdata/replace2.in
deleted file mode 100644
index 786469866f9..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/replace2.in
+++ /dev/null
@@ -1,10 +0,0 @@
-module "abc"
-
-replace (
- "xyz" v1.2.3 => "/tmp/z"
- "xyz" v1.3.4 => "my/xyz" "v1.3.4-me"
- xyz "v1.4.5" => "/tmp/my dir"
- xyz v1.5.6 => my/xyz v1.5.6
-
- xyz => my/other/xyz v1.5.4
-)
diff --git a/libgo/go/cmd/go/internal/modfile/testdata/rule1.golden b/libgo/go/cmd/go/internal/modfile/testdata/rule1.golden
deleted file mode 100644
index 8a5c7258948..00000000000
--- a/libgo/go/cmd/go/internal/modfile/testdata/rule1.golden
+++ /dev/null
@@ -1,7 +0,0 @@
-module "x"
-
-module "y"
-
-require "x"
-
-require x
diff --git a/libgo/go/cmd/go/internal/modget/get.go b/libgo/go/cmd/go/internal/modget/get.go
index 1cae311c4c1..2a0f6346581 100644
--- a/libgo/go/cmd/go/internal/modget/get.go
+++ b/libgo/go/cmd/go/internal/modget/get.go
@@ -6,25 +6,26 @@
package modget
import (
+ "errors"
+ "fmt"
+ "os"
+ "path/filepath"
+ "sort"
+ "strings"
+ "sync"
+
"cmd/go/internal/base"
- "cmd/go/internal/cfg"
"cmd/go/internal/get"
"cmd/go/internal/imports"
"cmd/go/internal/load"
"cmd/go/internal/modload"
- "cmd/go/internal/module"
"cmd/go/internal/mvs"
"cmd/go/internal/par"
"cmd/go/internal/search"
- "cmd/go/internal/semver"
"cmd/go/internal/work"
- "errors"
- "fmt"
- "os"
- "path/filepath"
- "sort"
- "strings"
- "sync"
+
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
)
var CmdGet = &base.Command{
@@ -199,7 +200,7 @@ func (v *upgradeFlag) Set(s string) error {
func (v *upgradeFlag) String() string { return "" }
func init() {
- work.AddBuildFlags(CmdGet)
+ work.AddBuildFlags(CmdGet, work.OmitModFlag)
CmdGet.Run = runGet // break init loop
CmdGet.Flag.BoolVar(&get.Insecure, "insecure", get.Insecure, "")
CmdGet.Flag.Var(&getU, "u", "")
@@ -256,11 +257,6 @@ type query struct {
}
func runGet(cmd *base.Command, args []string) {
- // -mod=readonly has no effect on "go get".
- if cfg.BuildMod == "readonly" {
- cfg.BuildMod = ""
- }
-
switch getU {
case "", "upgrade", "patch":
// ok
@@ -278,10 +274,6 @@ func runGet(cmd *base.Command, args []string) {
}
modload.LoadTests = *getT
- if cfg.BuildMod == "vendor" {
- base.Fatalf("go get: disabled by -mod=%s", cfg.BuildMod)
- }
-
buildList := modload.LoadBuildList()
buildList = buildList[:len(buildList):len(buildList)] // copy on append
versionByPath := make(map[string]string)
@@ -294,6 +286,10 @@ func runGet(cmd *base.Command, args []string) {
// what was requested.
modload.DisallowWriteGoMod()
+ // Allow looking up modules for import paths outside of a module.
+ // 'go get' is expected to do this, unlike other commands.
+ modload.AllowMissingModuleImports()
+
// Parse command-line arguments and report errors. The command-line
// arguments are of the form path@version or simply path, with implicit
// @upgrade. path@none is "downgrade away".
@@ -364,6 +360,10 @@ func runGet(cmd *base.Command, args []string) {
// upgrade golang.org/x/tools.
case path == "all":
+ // If there is no main module, "all" is not meaningful.
+ if !modload.HasModRoot() {
+ base.Errorf(`go get %s: cannot match "all": working directory is not part of a module`, arg)
+ }
// Don't query modules until we load packages. We'll automatically
// look up any missing modules.
@@ -372,13 +372,15 @@ func runGet(cmd *base.Command, args []string) {
continue
default:
- // The argument is a package path.
- if pkgs := modload.TargetPackages(path); len(pkgs) != 0 {
- // The path is in the main module. Nothing to query.
- if vers != "upgrade" && vers != "patch" {
- base.Errorf("go get %s: can't request explicit version of path in main module", arg)
+ // The argument is a package or module path.
+ if modload.HasModRoot() {
+ if pkgs := modload.TargetPackages(path); len(pkgs) != 0 {
+ // The path is in the main module. Nothing to query.
+ if vers != "upgrade" && vers != "patch" {
+ base.Errorf("go get %s: can't request explicit version of path in main module", arg)
+ }
+ continue
}
- continue
}
first := path
@@ -452,10 +454,13 @@ func runGet(cmd *base.Command, args []string) {
// This includes explicitly requested modules that don't have a root package
// and modules with a target version of "none".
var wg sync.WaitGroup
+ var modOnlyMu sync.Mutex
modOnly := make(map[string]*query)
for _, q := range queries {
if q.m.Version == "none" {
+ modOnlyMu.Lock()
modOnly[q.m.Path] = q
+ modOnlyMu.Unlock()
continue
}
if q.path == q.m.Path {
@@ -464,7 +469,9 @@ func runGet(cmd *base.Command, args []string) {
if hasPkg, err := modload.ModuleHasRootPackage(q.m); err != nil {
base.Errorf("go get: %v", err)
} else if !hasPkg {
+ modOnlyMu.Lock()
modOnly[q.m.Path] = q
+ modOnlyMu.Unlock()
}
wg.Done()
}(q)
@@ -763,6 +770,9 @@ func getQuery(path, vers string, prevM module.Version, forceModulePath bool) (mo
info, err := modload.Query(path, vers, prevM.Version, modload.Allowed)
if err == nil {
+ if info.Version != vers && info.Version != prevM.Version {
+ logOncef("go: %s %s => %s", path, vers, info.Version)
+ }
return module.Version{Path: path, Version: info.Version}, nil
}
@@ -791,6 +801,9 @@ func getQuery(path, vers string, prevM module.Version, forceModulePath bool) (mo
if !strings.Contains(path, "...") {
var modErr *modload.PackageNotInModuleError
if errors.As(err, &modErr) && modErr.Mod.Path == path {
+ if modErr.Mod.Version != vers {
+ logOncef("go: %s %s => %s", path, vers, modErr.Mod.Version)
+ }
return modErr.Mod, nil
}
}
@@ -798,7 +811,13 @@ func getQuery(path, vers string, prevM module.Version, forceModulePath bool) (mo
return module.Version{}, err
}
- return results[0].Mod, nil
+ m := results[0].Mod
+ if m.Path != path {
+ logOncef("go: found %s in %s %s", path, m.Path, m.Version)
+ } else if m.Version != vers {
+ logOncef("go: %s %s => %s", path, vers, m.Version)
+ }
+ return m, nil
}
// An upgrader adapts an underlying mvs.Reqs to apply an
@@ -955,6 +974,9 @@ func (u *upgrader) Upgrade(m module.Version) (module.Version, error) {
return m, nil
}
+ if info.Version != m.Version {
+ logOncef("go: %s %s => %s", m.Path, getU, info.Version)
+ }
return module.Version{Path: m.Path, Version: info.Version}, nil
}
@@ -983,3 +1005,12 @@ func (r *lostUpgradeReqs) Required(mod module.Version) ([]module.Version, error)
}
return r.Reqs.Required(mod)
}
+
+var loggedLines sync.Map
+
+func logOncef(format string, args ...interface{}) {
+ msg := fmt.Sprintf(format, args...)
+ if _, dup := loggedLines.LoadOrStore(msg, true); !dup {
+ fmt.Fprintln(os.Stderr, msg)
+ }
+}
diff --git a/libgo/go/cmd/go/internal/modload/build.go b/libgo/go/cmd/go/internal/modload/build.go
index 7cbdef1c36c..292fd45a4a6 100644
--- a/libgo/go/cmd/go/internal/modload/build.go
+++ b/libgo/go/cmd/go/internal/modload/build.go
@@ -6,13 +6,6 @@ package modload
import (
"bytes"
- "cmd/go/internal/base"
- "cmd/go/internal/cfg"
- "cmd/go/internal/modfetch"
- "cmd/go/internal/modinfo"
- "cmd/go/internal/module"
- "cmd/go/internal/search"
- "cmd/go/internal/semver"
"encoding/hex"
"fmt"
"internal/goroot"
@@ -20,6 +13,15 @@ import (
"path/filepath"
"runtime/debug"
"strings"
+
+ "cmd/go/internal/base"
+ "cmd/go/internal/cfg"
+ "cmd/go/internal/modfetch"
+ "cmd/go/internal/modinfo"
+ "cmd/go/internal/search"
+
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
)
var (
@@ -43,11 +45,19 @@ func findStandardImportPath(path string) string {
return ""
}
+// PackageModuleInfo returns information about the module that provides
+// a given package. If modules are not enabled or if the package is in the
+// standard library or if the package was not successfully loaded with
+// ImportPaths or a similar loading function, nil is returned.
func PackageModuleInfo(pkgpath string) *modinfo.ModulePublic {
if isStandardImportPath(pkgpath) || !Enabled() {
return nil
}
- return moduleInfo(findModule(pkgpath, pkgpath), true)
+ m, ok := findModule(pkgpath)
+ if !ok {
+ return nil
+ }
+ return moduleInfo(m, true)
}
func ModuleInfo(path string) *modinfo.ModulePublic {
@@ -119,13 +129,8 @@ func moduleInfo(m module.Version, fromBuildList bool) *modinfo.ModulePublic {
info.GoVersion = loaded.goVersion[m.Path]
}
- if cfg.BuildMod == "vendor" {
- info.Dir = filepath.Join(ModRoot(), "vendor", m.Path)
- return info
- }
-
- // complete fills in the extra fields in m.
- complete := func(m *modinfo.ModulePublic) {
+ // completeFromModCache fills in the extra fields in m using the module cache.
+ completeFromModCache := func(m *modinfo.ModulePublic) {
if m.Version != "" {
if q, err := Query(m.Path, m.Version, "", nil); err != nil {
m.Error = &modinfo.ModuleError{Err: err.Error()}
@@ -151,13 +156,21 @@ func moduleInfo(m module.Version, fromBuildList bool) *modinfo.ModulePublic {
}
if !fromBuildList {
- complete(info)
+ completeFromModCache(info) // Will set m.Error in vendor mode.
return info
}
r := Replacement(m)
if r.Path == "" {
- complete(info)
+ if cfg.BuildMod == "vendor" {
+ // It's tempting to fill in the "Dir" field to point within the vendor
+ // directory, but that would be misleading: the vendor directory contains
+ // a flattened package tree, not complete modules, and it can even
+ // interleave packages from different modules if one module path is a
+ // prefix of the other.
+ } else {
+ completeFromModCache(info)
+ }
return info
}
@@ -176,23 +189,29 @@ func moduleInfo(m module.Version, fromBuildList bool) *modinfo.ModulePublic {
} else {
info.Replace.Dir = filepath.Join(ModRoot(), r.Path)
}
+ info.Replace.GoMod = filepath.Join(info.Replace.Dir, "go.mod")
+ }
+ if cfg.BuildMod != "vendor" {
+ completeFromModCache(info.Replace)
+ info.Dir = info.Replace.Dir
+ info.GoMod = info.Replace.GoMod
}
- complete(info.Replace)
- info.Dir = info.Replace.Dir
- info.GoMod = filepath.Join(info.Dir, "go.mod")
return info
}
+// PackageBuildInfo returns a string containing module version information
+// for modules providing packages named by path and deps. path and deps must
+// name packages that were resolved successfully with ImportPaths or one of
+// the Load functions.
func PackageBuildInfo(path string, deps []string) string {
if isStandardImportPath(path) || !Enabled() {
return ""
}
-
- target := findModule(path, path)
+ target := mustFindModule(path, path)
mdeps := make(map[module.Version]bool)
for _, dep := range deps {
if !isStandardImportPath(dep) {
- mdeps[findModule(path, dep)] = true
+ mdeps[mustFindModule(path, dep)] = true
}
}
var mods []module.Version
@@ -227,9 +246,12 @@ func PackageBuildInfo(path string, deps []string) string {
return buf.String()
}
-// findModule returns the module containing the package at path,
-// needed to build the package at target.
-func findModule(target, path string) module.Version {
+// mustFindModule is like findModule, but it calls base.Fatalf if the
+// module can't be found.
+//
+// TODO(jayconrod): remove this. Callers should use findModule and return
+// errors instead of relying on base.Fatalf.
+func mustFindModule(target, path string) module.Version {
pkg, ok := loaded.pkgCache.Get(path).(*loadPkg)
if ok {
if pkg.err != nil {
@@ -249,17 +271,49 @@ func findModule(target, path string) module.Version {
panic("unreachable")
}
-func ModInfoProg(info string) []byte {
+// findModule searches for the module that contains the package at path.
+// If the package was loaded with ImportPaths or one of the other loading
+// functions, its containing module and true are returned. Otherwise,
+// module.Version{} and false are returend.
+func findModule(path string) (module.Version, bool) {
+ if pkg, ok := loaded.pkgCache.Get(path).(*loadPkg); ok {
+ return pkg.mod, pkg.mod != module.Version{}
+ }
+ if path == "command-line-arguments" {
+ return Target, true
+ }
+ return module.Version{}, false
+}
+
+func ModInfoProg(info string, isgccgo bool) []byte {
// Inject a variable with the debug information as runtime.modinfo,
// but compile it in package main so that it is specific to the binary.
// The variable must be a literal so that it will have the correct value
// before the initializer for package main runs.
//
- // The runtime startup code refers to the variable, which keeps it live in all binaries.
- return []byte(fmt.Sprintf(`package main
+ // The runtime startup code refers to the variable, which keeps it live
+ // in all binaries.
+ //
+ // Note: we use an alternate recipe below for gccgo (based on an
+ // init function) due to the fact that gccgo does not support
+ // applying a "//go:linkname" directive to a variable. This has
+ // drawbacks in that other packages may want to look at the module
+ // info in their init functions (see issue 29628), which won't
+ // work for gccgo. See also issue 30344.
+
+ if !isgccgo {
+ return []byte(fmt.Sprintf(`package main
import _ "unsafe"
//go:linkname __set_modinfo__ runtime.setmodinfo
func __set_modinfo__(string)
func init() { __set_modinfo__(%q) }
`, string(infoStart)+info+string(infoEnd)))
+ } else {
+ return []byte(fmt.Sprintf(`package main
+import _ "unsafe"
+//go:linkname __set_debug_modinfo__ runtime.setmodinfo
+func __set_debug_modinfo__(string)
+func init() { __set_debug_modinfo__(%q) }
+ `, string(infoStart)+info+string(infoEnd)))
+ }
}
diff --git a/libgo/go/cmd/go/internal/modload/help.go b/libgo/go/cmd/go/internal/modload/help.go
index 1927c1cff73..b47f3dedb37 100644
--- a/libgo/go/cmd/go/internal/modload/help.go
+++ b/libgo/go/cmd/go/internal/modload/help.go
@@ -179,6 +179,9 @@ If invoked with -mod=vendor, the go command assumes that the vendor
directory holds the correct copies of dependencies and ignores
the dependency descriptions in go.mod.
+If invoked with -mod=mod, the go command loads modules from the module cache
+even if there is a vendor directory present.
+
Pseudo-versions
The go.mod file and the go command more generally use semantic versions as
diff --git a/libgo/go/cmd/go/internal/modload/import.go b/libgo/go/cmd/go/internal/modload/import.go
index 70add3507a2..9ae2900e469 100644
--- a/libgo/go/cmd/go/internal/modload/import.go
+++ b/libgo/go/cmd/go/internal/modload/import.go
@@ -5,7 +5,6 @@
package modload
import (
- "bytes"
"errors"
"fmt"
"go/build"
@@ -17,31 +16,81 @@ import (
"time"
"cmd/go/internal/cfg"
+ "cmd/go/internal/load"
"cmd/go/internal/modfetch"
- "cmd/go/internal/module"
"cmd/go/internal/par"
"cmd/go/internal/search"
- "cmd/go/internal/semver"
- "cmd/go/internal/str"
+
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
)
type ImportMissingError struct {
- ImportPath string
- Module module.Version
+ Path string
+ Module module.Version
+ QueryErr error
// newMissingVersion is set to a newer version of Module if one is present
// in the build list. When set, we can't automatically upgrade.
newMissingVersion string
}
+var _ load.ImportPathError = (*ImportMissingError)(nil)
+
func (e *ImportMissingError) Error() string {
if e.Module.Path == "" {
- if str.HasPathPrefix(e.ImportPath, "cmd") {
- return fmt.Sprintf("package %s is not in GOROOT (%s)", e.ImportPath, filepath.Join(cfg.GOROOT, "src", e.ImportPath))
+ if search.IsStandardImportPath(e.Path) {
+ return fmt.Sprintf("package %s is not in GOROOT (%s)", e.Path, filepath.Join(cfg.GOROOT, "src", e.Path))
+ }
+ if e.QueryErr != nil {
+ return fmt.Sprintf("cannot find module providing package %s: %v", e.Path, e.QueryErr)
+ }
+ return "cannot find module providing package " + e.Path
+ }
+ return fmt.Sprintf("missing module for import: %s@%s provides %s", e.Module.Path, e.Module.Version, e.Path)
+}
+
+func (e *ImportMissingError) Unwrap() error {
+ return e.QueryErr
+}
+
+func (e *ImportMissingError) ImportPath() string {
+ return e.Path
+}
+
+// An AmbiguousImportError indicates an import of a package found in multiple
+// modules in the build list, or found in both the main module and its vendor
+// directory.
+type AmbiguousImportError struct {
+ ImportPath string
+ Dirs []string
+ Modules []module.Version // Either empty or 1:1 with Dirs.
+}
+
+func (e *AmbiguousImportError) Error() string {
+ locType := "modules"
+ if len(e.Modules) == 0 {
+ locType = "directories"
+ }
+
+ var buf strings.Builder
+ fmt.Fprintf(&buf, "ambiguous import: found package %s in multiple %s:", e.ImportPath, locType)
+
+ for i, dir := range e.Dirs {
+ buf.WriteString("\n\t")
+ if i < len(e.Modules) {
+ m := e.Modules[i]
+ buf.WriteString(m.Path)
+ if m.Version != "" {
+ fmt.Fprintf(&buf, " %s", m.Version)
+ }
+ fmt.Fprintf(&buf, " (%s)", dir)
+ } else {
+ buf.WriteString(dir)
}
- return "cannot find module providing package " + e.ImportPath
}
- return "missing module for import: " + e.Module.Path + "@" + e.Module.Version + " provides " + e.ImportPath
+
+ return buf.String()
}
// Import finds the module and directory in the build list
@@ -68,8 +117,8 @@ func Import(path string) (m module.Version, dir string, err error) {
}
// Is the package in the standard library?
- if search.IsStandardImportPath(path) &&
- goroot.IsStandardPackage(cfg.GOROOT, cfg.BuildContext.Compiler, path) {
+ pathIsStd := search.IsStandardImportPath(path)
+ if pathIsStd && goroot.IsStandardPackage(cfg.GOROOT, cfg.BuildContext.Compiler, path) {
if targetInGorootSrc {
if dir, ok := dirInModule(path, targetPrefix, ModRoot(), true); ok {
return Target, dir, nil
@@ -78,9 +127,6 @@ func Import(path string) (m module.Version, dir string, err error) {
dir := filepath.Join(cfg.GOROOT, "src", path)
return module.Version{}, dir, nil
}
- if str.HasPathPrefix(path, "cmd") {
- return module.Version{}, "", &ImportMissingError{ImportPath: path}
- }
// -mod=vendor is special.
// Everything must be in the main module or the main module's vendor directory.
@@ -88,7 +134,7 @@ func Import(path string) (m module.Version, dir string, err error) {
mainDir, mainOK := dirInModule(path, targetPrefix, ModRoot(), true)
vendorDir, vendorOK := dirInModule(path, "", filepath.Join(ModRoot(), "vendor"), false)
if mainOK && vendorOK {
- return module.Version{}, "", fmt.Errorf("ambiguous import: found %s in multiple directories:\n\t%s\n\t%s", path, mainDir, vendorDir)
+ return module.Version{}, "", &AmbiguousImportError{ImportPath: path, Dirs: []string{mainDir, vendorDir}}
}
// Prefer to return main directory if there is one,
// Note that we're not checking that the package exists.
@@ -97,7 +143,7 @@ func Import(path string) (m module.Version, dir string, err error) {
return Target, mainDir, nil
}
readVendorList()
- return vendorMap[path], vendorDir, nil
+ return vendorPkgModule[path], vendorDir, nil
}
// Check each module on the build list.
@@ -128,22 +174,26 @@ func Import(path string) (m module.Version, dir string, err error) {
return mods[0], dirs[0], nil
}
if len(mods) > 0 {
- var buf bytes.Buffer
- fmt.Fprintf(&buf, "ambiguous import: found %s in multiple modules:", path)
- for i, m := range mods {
- fmt.Fprintf(&buf, "\n\t%s", m.Path)
- if m.Version != "" {
- fmt.Fprintf(&buf, " %s", m.Version)
- }
- fmt.Fprintf(&buf, " (%s)", dirs[i])
- }
- return module.Version{}, "", errors.New(buf.String())
+ return module.Version{}, "", &AmbiguousImportError{ImportPath: path, Dirs: dirs, Modules: mods}
}
// Look up module containing the package, for addition to the build list.
// Goal is to determine the module, download it to dir, and return m, dir, ErrMissing.
if cfg.BuildMod == "readonly" {
- return module.Version{}, "", fmt.Errorf("import lookup disabled by -mod=%s", cfg.BuildMod)
+ var queryErr error
+ if !pathIsStd {
+ if cfg.BuildModReason == "" {
+ queryErr = fmt.Errorf("import lookup disabled by -mod=%s", cfg.BuildMod)
+ }
+ queryErr = fmt.Errorf("import lookup disabled by -mod=%s\n\t(%s)", cfg.BuildMod, cfg.BuildModReason)
+ }
+ return module.Version{}, "", &ImportMissingError{Path: path, QueryErr: queryErr}
+ }
+ if modRoot == "" && !allowMissingModuleImports {
+ return module.Version{}, "", &ImportMissingError{
+ Path: path,
+ QueryErr: errors.New("working directory is not part of a module"),
+ }
}
// Not on build list.
@@ -187,9 +237,31 @@ func Import(path string) (m module.Version, dir string, err error) {
}
_, ok := dirInModule(path, m.Path, root, isLocal)
if ok {
- return m, "", &ImportMissingError{ImportPath: path, Module: m}
+ return m, "", &ImportMissingError{Path: path, Module: m}
}
}
+ if len(mods) > 0 && module.CheckPath(path) != nil {
+ // The package path is not valid to fetch remotely,
+ // so it can only exist if in a replaced module,
+ // and we know from the above loop that it is not.
+ return module.Version{}, "", &PackageNotInModuleError{
+ Mod: mods[0],
+ Query: "latest",
+ Pattern: path,
+ Replacement: Replacement(mods[0]),
+ }
+ }
+ }
+
+ if pathIsStd {
+ // This package isn't in the standard library, isn't in any module already
+ // in the build list, and isn't in any other module that the user has
+ // shimmed in via a "replace" directive.
+ // Moreover, the import path is reserved for the standard library, so
+ // QueryPackage cannot possibly find a module containing this package.
+ //
+ // Instead of trying QueryPackage, report an ImportMissingError immediately.
+ return module.Version{}, "", &ImportMissingError{Path: path}
}
candidates, err := QueryPackage(path, "latest", Allowed)
@@ -197,7 +269,7 @@ func Import(path string) (m module.Version, dir string, err error) {
if errors.Is(err, os.ErrNotExist) {
// Return "cannot find module providing package […]" instead of whatever
// low-level error QueryPackage produced.
- return module.Version{}, "", &ImportMissingError{ImportPath: path}
+ return module.Version{}, "", &ImportMissingError{Path: path, QueryErr: err}
} else {
return module.Version{}, "", err
}
@@ -222,7 +294,7 @@ func Import(path string) (m module.Version, dir string, err error) {
}
}
}
- return m, "", &ImportMissingError{ImportPath: path, Module: m, newMissingVersion: newMissingVersion}
+ return m, "", &ImportMissingError{Path: path, Module: m, newMissingVersion: newMissingVersion}
}
// maybeInModule reports whether, syntactically,
diff --git a/libgo/go/cmd/go/internal/modload/import_test.go b/libgo/go/cmd/go/internal/modload/import_test.go
index c6ade5d17f4..accc60eecdf 100644
--- a/libgo/go/cmd/go/internal/modload/import_test.go
+++ b/libgo/go/cmd/go/internal/modload/import_test.go
@@ -21,7 +21,7 @@ var importTests = []struct {
},
{
path: "golang.org/x/net",
- err: "module golang.org/x/net@.* found, but does not contain package golang.org/x/net",
+ err: `module golang.org/x/net@.* found \(v0.0.0-.*\), but does not contain package golang.org/x/net`,
},
{
path: "golang.org/x/text",
@@ -44,6 +44,10 @@ var importTests = []struct {
func TestImport(t *testing.T) {
testenv.MustHaveExternalNetwork(t)
testenv.MustHaveExecPath(t, "git")
+ defer func(old bool) {
+ allowMissingModuleImports = old
+ }(allowMissingModuleImports)
+ AllowMissingModuleImports()
for _, tt := range importTests {
t.Run(strings.ReplaceAll(tt.path, "/", "_"), func(t *testing.T) {
diff --git a/libgo/go/cmd/go/internal/modload/init.go b/libgo/go/cmd/go/internal/modload/init.go
index 807ce8d5dc5..61cbdf2c543 100644
--- a/libgo/go/cmd/go/internal/modload/init.go
+++ b/libgo/go/cmd/go/internal/modload/init.go
@@ -7,6 +7,7 @@ package modload
import (
"bytes"
"encoding/json"
+ "errors"
"fmt"
"go/build"
"internal/lazyregexp"
@@ -22,26 +23,24 @@ import (
"cmd/go/internal/cache"
"cmd/go/internal/cfg"
"cmd/go/internal/load"
+ "cmd/go/internal/lockedfile"
"cmd/go/internal/modconv"
"cmd/go/internal/modfetch"
"cmd/go/internal/modfetch/codehost"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
"cmd/go/internal/mvs"
- "cmd/go/internal/renameio"
"cmd/go/internal/search"
+
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
)
var (
- cwd string // TODO(bcmills): Is this redundant with base.Cwd?
mustUseModules = false
initialized bool
- modRoot string
- modFile *modfile.File
- modFileData []byte
- excluded map[module.Version]bool
- Target module.Version
+ modRoot string
+ Target module.Version
// targetPrefix is the path prefix for packages in Target, without a trailing
// slash. For most modules, targetPrefix is just Target.Path, but the
@@ -56,8 +55,31 @@ var (
CmdModInit bool // running 'go mod init'
CmdModModule string // module argument for 'go mod init'
+
+ allowMissingModuleImports bool
)
+var modFile *modfile.File
+
+// A modFileIndex is an index of data corresponding to a modFile
+// at a specific point in time.
+type modFileIndex struct {
+ data []byte
+ dataNeedsFix bool // true if fixVersion applied a change while parsing data
+ module module.Version
+ goVersion string
+ require map[module.Version]requireMeta
+ replace map[module.Version]module.Version
+ exclude map[module.Version]bool
+}
+
+// index is the index of the go.mod file as of when it was last read or written.
+var index *modFileIndex
+
+type requireMeta struct {
+ indirect bool
+}
+
// ModFile returns the parsed go.mod file.
//
// Note that after calling ImportPaths or LoadBuildList,
@@ -89,6 +111,9 @@ func Init() {
}
initialized = true
+ // Keep in sync with WillBeEnabled. We perform extra validation here, and
+ // there are lots of diagnostics and side effects, so we can't use
+ // WillBeEnabled directly.
env := cfg.Getenv("GO111MODULE")
switch env {
default:
@@ -129,18 +154,15 @@ func Init() {
os.Setenv("GIT_SSH_COMMAND", "ssh -o ControlMaster=no")
}
- var err error
- cwd, err = os.Getwd()
- if err != nil {
- base.Fatalf("go: %v", err)
- }
-
if CmdModInit {
// Running 'go mod init': go.mod will be created in current directory.
- modRoot = cwd
+ modRoot = base.Cwd
} else {
- modRoot = findModuleRoot(cwd)
+ modRoot = findModuleRoot(base.Cwd)
if modRoot == "" {
+ if cfg.ModFile != "" {
+ base.Fatalf("go: cannot find main module, but -modfile was set.\n\t-modfile cannot be used to set the module root directory.")
+ }
if !mustUseModules {
// GO111MODULE is 'auto', and we can't find a module root.
// Stay in GOPATH mode.
@@ -156,6 +178,9 @@ func Init() {
fmt.Fprintf(os.Stderr, "go: warning: ignoring go.mod in system temp root %v\n", os.TempDir())
}
}
+ if cfg.ModFile != "" && !strings.HasSuffix(cfg.ModFile, ".mod") {
+ base.Fatalf("go: -modfile=%s: file does not have .mod extension", cfg.ModFile)
+ }
// We're in module mode. Install the hooks to make it work.
@@ -198,30 +223,23 @@ func Init() {
if modRoot == "" {
// We're in module mode, but not inside a module.
//
- // If the command is 'go get' or 'go list' and all of the args are in the
- // same existing module, we could use that module's download directory in
- // the module cache as the module root, applying any replacements and/or
- // exclusions specified by that module. However, that would leave us in a
- // strange state: we want 'go get' to be consistent with 'go list', and 'go
- // list' should be able to operate on multiple modules. Moreover, the 'get'
- // target might specify relative file paths (e.g. in the same repository) as
- // replacements, and we would not be able to apply those anyway: we would
- // need to either error out or ignore just those replacements, when a build
- // from an empty module could proceed without error.
+ // Commands like 'go build', 'go run', 'go list' have no go.mod file to
+ // read or write. They would need to find and download the latest versions
+ // of a potentially large number of modules with no way to save version
+ // information. We can succeed slowly (but not reproducibly), but that's
+ // not usually a good experience.
//
- // Instead, we'll operate as though we're in some ephemeral external module,
- // ignoring all replacements and exclusions uniformly.
-
- // Normally we check sums using the go.sum file from the main module, but
- // without a main module we do not have an authoritative go.sum file.
+ // Instead, we forbid resolving import paths to modules other than std and
+ // cmd. Users may still build packages specified with .go files on the
+ // command line, but they'll see an error if those files import anything
+ // outside std.
//
- // TODO(bcmills): In Go 1.13, check sums when outside the main module.
+ // This can be overridden by calling AllowMissingModuleImports.
+ // For example, 'go get' does this, since it is expected to resolve paths.
//
- // One possible approach is to merge the go.sum files from all of the
- // modules we download: that doesn't protect us against bad top-level
- // modules, but it at least ensures consistency for transitive dependencies.
+ // See golang.org/issue/32027.
} else {
- modfetch.GoSumFile = filepath.Join(modRoot, "go.sum")
+ modfetch.GoSumFile = strings.TrimSuffix(ModFilePath(), ".mod") + ".sum"
search.SetModRoot(modRoot)
}
}
@@ -237,6 +255,54 @@ func init() {
}
}
+// WillBeEnabled checks whether modules should be enabled but does not
+// initialize modules by installing hooks. If Init has already been called,
+// WillBeEnabled returns the same result as Enabled.
+//
+// This function is needed to break a cycle. The main package needs to know
+// whether modules are enabled in order to install the module or GOPATH version
+// of 'go get', but Init reads the -modfile flag in 'go get', so it shouldn't
+// be called until the command is installed and flags are parsed. Instead of
+// calling Init and Enabled, the main package can call this function.
+func WillBeEnabled() bool {
+ if modRoot != "" || mustUseModules {
+ return true
+ }
+ if initialized {
+ return false
+ }
+
+ // Keep in sync with Init. Init does extra validation and prints warnings or
+ // exits, so it can't call this function directly.
+ env := cfg.Getenv("GO111MODULE")
+ switch env {
+ case "on":
+ return true
+ case "auto", "":
+ break
+ default:
+ return false
+ }
+
+ if CmdModInit {
+ // Running 'go mod init': go.mod will be created in current directory.
+ return true
+ }
+ if modRoot := findModuleRoot(base.Cwd); modRoot == "" {
+ // GO111MODULE is 'auto', and we can't find a module root.
+ // Stay in GOPATH mode.
+ return false
+ } else if search.InDir(modRoot, os.TempDir()) == "." {
+ // If you create /tmp/go.mod for experimenting,
+ // then any tests that create work directories under /tmp
+ // will find it and get modules when they're not expecting them.
+ // It's a bit of a peculiar thing to disallow but quite mysterious
+ // when it happens. See golang.org/issue/26708.
+ return false
+ }
+ return true
+}
+
// Enabled reports whether modules are (or must be) enabled.
// If modules are enabled but there is no main module, Enabled returns true
// and then the first use of module information will call die
@@ -263,6 +329,20 @@ func HasModRoot() bool {
return modRoot != ""
}
+// ModFilePath returns the effective path of the go.mod file. Normally, this
+// "go.mod" in the directory returned by ModRoot, but the -modfile flag may
+// change its location. ModFilePath calls base.Fatalf if there is no main
+// module, even if -modfile is set.
+func ModFilePath() string {
+ if !HasModRoot() {
+ die()
+ }
+ if cfg.ModFile != "" {
+ return cfg.ModFile
+ }
+ return filepath.Join(modRoot, "go.mod")
+}
+
// printStackInDie causes die to print a stack trace.
//
// It is enabled by the testgo tag, and helps to diagnose paths that
@@ -276,24 +356,25 @@ func die() {
if cfg.Getenv("GO111MODULE") == "off" {
base.Fatalf("go: modules disabled by GO111MODULE=off; see 'go help modules'")
}
- if cwd != "" {
- if dir, name := findAltConfig(cwd); dir != "" {
- rel, err := filepath.Rel(cwd, dir)
- if err != nil {
- rel = dir
- }
- cdCmd := ""
- if rel != "." {
- cdCmd = fmt.Sprintf("cd %s && ", rel)
- }
- base.Fatalf("go: cannot find main module, but found %s in %s\n\tto create a module there, run:\n\t%sgo mod init", name, dir, cdCmd)
+ if dir, name := findAltConfig(base.Cwd); dir != "" {
+ rel, err := filepath.Rel(base.Cwd, dir)
+ if err != nil {
+ rel = dir
}
+ cdCmd := ""
+ if rel != "." {
+ cdCmd = fmt.Sprintf("cd %s && ", rel)
+ }
+ base.Fatalf("go: cannot find main module, but found %s in %s\n\tto create a module there, run:\n\t%sgo mod init", name, dir, cdCmd)
}
base.Fatalf("go: cannot find main module; see 'go help modules'")
}
// InitMod sets Target and, if there is a main module, parses the initial build
// list from its go.mod file, creating and populating that file if needed.
+//
+// As a side-effect, InitMod sets a default for cfg.BuildMod if it does not
+// already have an explicit value.
func InitMod() {
if len(buildList) > 0 {
return
@@ -315,19 +396,20 @@ func InitMod() {
return
}
- gomod := filepath.Join(modRoot, "go.mod")
- data, err := renameio.ReadFile(gomod)
+ gomod := ModFilePath()
+ data, err := lockedfile.Read(gomod)
if err != nil {
base.Fatalf("go: %v", err)
}
- f, err := modfile.Parse(gomod, data, fixVersion)
+ var fixed bool
+ f, err := modfile.Parse(gomod, data, fixVersion(&fixed))
if err != nil {
// Errors returned by modfile.Parse begin with file:line.
base.Fatalf("go: errors parsing go.mod:\n%s\n", err)
}
modFile = f
- modFileData = data
+ index = indexModFile(data, f, fixed)
if len(f.Syntax.Stmt) == 0 || f.Module == nil {
// Empty mod file. Must add module path.
@@ -344,20 +426,77 @@ func InitMod() {
legacyModInit()
}
- excluded = make(map[module.Version]bool)
- for _, x := range f.Exclude {
- excluded[x.Mod] = true
- }
modFileToBuildList()
- stdVendorMode()
- WriteGoMod()
+ setDefaultBuildMod()
+ if cfg.BuildMod == "vendor" {
+ readVendorList()
+ checkVendorConsistency()
+ } else {
+ // TODO(golang.org/issue/33326): if cfg.BuildMod != "readonly"?
+ WriteGoMod()
+ }
+}
+
+// fixVersion returns a modfile.VersionFixer implemented using the Query function.
+//
+// It resolves commit hashes and branch names to versions,
+// canonicalizes versions that appeared in early vgo drafts,
+// and does nothing for versions that already appear to be canonical.
+//
+// The VersionFixer sets 'fixed' if it ever returns a non-canonical version.
+func fixVersion(fixed *bool) modfile.VersionFixer {
+ return func(path, vers string) (resolved string, err error) {
+ defer func() {
+ if err == nil && resolved != vers {
+ *fixed = true
+ }
+ }()
+
+ // Special case: remove the old -gopkgin- hack.
+ if strings.HasPrefix(path, "gopkg.in/") && strings.Contains(vers, "-gopkgin-") {
+ vers = vers[strings.Index(vers, "-gopkgin-")+len("-gopkgin-"):]
+ }
+
+ // fixVersion is called speculatively on every
+ // module, version pair from every go.mod file.
+ // Avoid the query if it looks OK.
+ _, pathMajor, ok := module.SplitPathVersion(path)
+ if !ok {
+ return "", &module.ModuleError{
+ Path: path,
+ Err: &module.InvalidVersionError{
+ Version: vers,
+ Err: fmt.Errorf("malformed module path %q", path),
+ },
+ }
+ }
+ if vers != "" && module.CanonicalVersion(vers) == vers {
+ if err := module.CheckPathMajor(vers, pathMajor); err == nil {
+ return vers, nil
+ }
+ }
+
+ info, err := Query(path, vers, "", nil)
+ if err != nil {
+ return "", err
+ }
+ return info.Version, nil
+ }
+}
+
+// AllowMissingModuleImports allows import paths to be resolved to modules
+// when there is no module root. Normally, this is forbidden because it's slow
+// and there's no way to make the result reproducible, but some commands
+// like 'go get' are expected to do this.
+func AllowMissingModuleImports() {
+ allowMissingModuleImports = true
}
// modFileToBuildList initializes buildList from the modFile.
func modFileToBuildList() {
Target = modFile.Module.Mod
targetPrefix = Target.Path
- if rel := search.InDir(cwd, cfg.GOROOTsrc); rel != "" {
+ if rel := search.InDir(base.Cwd, cfg.GOROOTsrc); rel != "" {
targetInGorootSrc = true
if Target.Path == "std" {
targetPrefix = ""
@@ -371,45 +510,144 @@ func modFileToBuildList() {
buildList = list
}
-// stdVendorMode applies inside $GOROOT/src.
-// It checks that the go.mod matches vendor/modules.txt
-// and then sets -mod=vendor unless this is a command
-// that has to do explicitly with modules.
-func stdVendorMode() {
- if !targetInGorootSrc {
+// setDefaultBuildMod sets a default value for cfg.BuildMod
+// if it is currently empty.
+func setDefaultBuildMod() {
+ if cfg.BuildMod != "" {
+ // Don't override an explicit '-mod=' argument.
return
}
+ cfg.BuildMod = "mod"
if cfg.CmdName == "get" || strings.HasPrefix(cfg.CmdName, "mod ") {
+ // Don't set -mod implicitly for commands whose purpose is to
+ // manipulate the build list.
+ return
+ }
+ if modRoot == "" {
return
}
+ if fi, err := os.Stat(filepath.Join(modRoot, "vendor")); err == nil && fi.IsDir() {
+ modGo := "unspecified"
+ if index.goVersion != "" {
+ if semver.Compare("v"+index.goVersion, "v1.14") >= 0 {
+ // The Go version is at least 1.14, and a vendor directory exists.
+ // Set -mod=vendor by default.
+ cfg.BuildMod = "vendor"
+ cfg.BuildModReason = "Go version in go.mod is at least 1.14 and vendor directory exists."
+ return
+ } else {
+ modGo = index.goVersion
+ }
+ }
+
+ // Since a vendor directory exists, we have a non-trivial reason for
+ // choosing -mod=mod, although it probably won't be used for anything.
+ // Record the reason anyway for consistency.
+ // It may be overridden if we switch to mod=readonly below.
+ cfg.BuildModReason = fmt.Sprintf("Go version in go.mod is %s.", modGo)
+ }
+
+ p := ModFilePath()
+ if fi, err := os.Stat(p); err == nil && !hasWritePerm(p, fi) {
+ cfg.BuildMod = "readonly"
+ cfg.BuildModReason = "go.mod file is read-only."
+ }
+}
+
+// checkVendorConsistency verifies that the vendor/modules.txt file matches (if
+// go 1.14) or at least does not contradict (go 1.13 or earlier) the
+// requirements and replacements listed in the main module's go.mod file.
+func checkVendorConsistency() {
readVendorList()
-BuildList:
- for _, m := range buildList {
- if m.Path == "cmd" || m.Path == "std" {
- continue
+
+ pre114 := false
+ if modFile.Go == nil || semver.Compare("v"+modFile.Go.Version, "v1.14") < 0 {
+ // Go versions before 1.14 did not include enough information in
+ // vendor/modules.txt to check for consistency.
+ // If we know that we're on an earlier version, relax the consistency check.
+ pre114 = true
+ }
+
+ vendErrors := new(strings.Builder)
+ vendErrorf := func(mod module.Version, format string, args ...interface{}) {
+ detail := fmt.Sprintf(format, args...)
+ if mod.Version == "" {
+ fmt.Fprintf(vendErrors, "\n\t%s: %s", mod.Path, detail)
+ } else {
+ fmt.Fprintf(vendErrors, "\n\t%s@%s: %s", mod.Path, mod.Version, detail)
}
- for _, v := range vendorList {
- if m.Path == v.Path {
- if m.Version != v.Version {
- base.Fatalf("go: inconsistent vendoring in %s:\n"+
- "\tgo.mod requires %s %s but vendor/modules.txt has %s.\n"+
- "\trun 'go mod tidy; go mod vendor' to sync",
- modRoot, m.Path, m.Version, v.Version)
+ }
+
+ for _, r := range modFile.Require {
+ if !vendorMeta[r.Mod].Explicit {
+ if pre114 {
+ // Before 1.14, modules.txt did not indicate whether modules were listed
+ // explicitly in the main module's go.mod file.
+ // However, we can at least detect a version mismatch if packages were
+ // vendored from a non-matching version.
+ if vv, ok := vendorVersion[r.Mod.Path]; ok && vv != r.Mod.Version {
+ vendErrorf(r.Mod, fmt.Sprintf("is explicitly required in go.mod, but vendor/modules.txt indicates %s@%s", r.Mod.Path, vv))
}
- continue BuildList
+ } else {
+ vendErrorf(r.Mod, "is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt")
+ }
+ }
+ }
+
+ describe := func(m module.Version) string {
+ if m.Version == "" {
+ return m.Path
+ }
+ return m.Path + "@" + m.Version
+ }
+
+ // We need to verify *all* replacements that occur in modfile: even if they
+ // don't directly apply to any module in the vendor list, the replacement
+ // go.mod file can affect the selected versions of other (transitive)
+ // dependencies
+ for _, r := range modFile.Replace {
+ vr := vendorMeta[r.Old].Replacement
+ if vr == (module.Version{}) {
+ if pre114 && (r.Old.Version == "" || vendorVersion[r.Old.Path] != r.Old.Version) {
+ // Before 1.14, modules.txt omitted wildcard replacements and
+ // replacements for modules that did not have any packages to vendor.
+ } else {
+ vendErrorf(r.Old, "is replaced in go.mod, but not marked as replaced in vendor/modules.txt")
+ }
+ } else if vr != r.New {
+ vendErrorf(r.Old, "is replaced by %s in go.mod, but marked as replaced by %s in vendor/modules.txt", describe(r.New), describe(vr))
+ }
+ }
+
+ for _, mod := range vendorList {
+ meta := vendorMeta[mod]
+ if meta.Explicit {
+ if _, inGoMod := index.require[mod]; !inGoMod {
+ vendErrorf(mod, "is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod")
}
}
- base.Fatalf("go: inconsistent vendoring in %s:\n"+
- "\tgo.mod requires %s %s but vendor/modules.txt does not include it.\n"+
- "\trun 'go mod tidy; go mod vendor' to sync", modRoot, m.Path, m.Version)
}
- cfg.BuildMod = "vendor"
+
+ for _, mod := range vendorReplaced {
+ r := Replacement(mod)
+ if r == (module.Version{}) {
+ vendErrorf(mod, "is marked as replaced in vendor/modules.txt, but not replaced in go.mod")
+ continue
+ }
+ if meta := vendorMeta[mod]; r != meta.Replacement {
+ vendErrorf(mod, "is marked as replaced by %s in vendor/modules.txt, but replaced by %s in go.mod", describe(meta.Replacement), describe(r))
+ }
+ }
+
+ if vendErrors.Len() > 0 {
+ base.Fatalf("go: inconsistent vendoring in %s:%s\n\nrun 'go mod vendor' to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory", modRoot, vendErrors)
+ }
}
// Allowed reports whether module m is allowed (not excluded) by the main module's go.mod.
func Allowed(m module.Version) bool {
- return !excluded[m]
+ return index == nil || !index.exclude[m]
}
func legacyModInit() {
@@ -478,6 +716,9 @@ var altConfigs = []string{
}
func findModuleRoot(dir string) (root string) {
+ if dir == "" {
+ panic("dir not set")
+ }
dir = filepath.Clean(dir)
// Look for enclosing go.mod.
@@ -495,6 +736,9 @@ func findModuleRoot(dir string) (root string) {
}
func findAltConfig(dir string) (root, name string) {
+ if dir == "" {
+ panic("dir not set")
+ }
dir = filepath.Clean(dir)
for {
for _, name := range altConfigs {
@@ -625,16 +869,17 @@ func AllowWriteGoMod() {
allowWriteGoMod = true
}
-// MinReqs returns a Reqs with minimal dependencies of Target,
+// MinReqs returns a Reqs with minimal additional dependencies of Target,
// as will be written to go.mod.
func MinReqs() mvs.Reqs {
- var direct []string
+ var retain []string
for _, m := range buildList[1:] {
- if loaded.direct[m.Path] {
- direct = append(direct, m.Path)
+ _, explicit := index.require[m]
+ if explicit || loaded.direct[m.Path] {
+ retain = append(retain, m.Path)
}
}
- min, err := mvs.Req(Target, buildList, direct, Reqs())
+ min, err := mvs.Req(Target, retain, Reqs())
if err != nil {
base.Fatalf("go: %v", err)
}
@@ -655,7 +900,9 @@ func WriteGoMod() {
return
}
- addGoStmt()
+ if cfg.BuildMod != "readonly" {
+ addGoStmt()
+ }
if loaded != nil {
reqs := MinReqs()
@@ -672,87 +919,177 @@ func WriteGoMod() {
}
modFile.SetRequire(list)
}
+ modFile.Cleanup()
- modFile.Cleanup() // clean file after edits
- new, err := modFile.Format()
- if err != nil {
- base.Fatalf("go: %v", err)
- }
-
- dirty := !bytes.Equal(new, modFileData)
+ dirty := index.modFileIsDirty(modFile)
if dirty && cfg.BuildMod == "readonly" {
// If we're about to fail due to -mod=readonly,
// prefer to report a dirty go.mod over a dirty go.sum
- base.Fatalf("go: updates to go.mod needed, disabled by -mod=readonly")
+ if cfg.BuildModReason != "" {
+ base.Fatalf("go: updates to go.mod needed, disabled by -mod=readonly\n\t(%s)", cfg.BuildModReason)
+ } else {
+ base.Fatalf("go: updates to go.mod needed, disabled by -mod=readonly")
+ }
}
// Always update go.sum, even if we didn't change go.mod: we may have
// downloaded modules that we didn't have before.
modfetch.WriteGoSum()
- if !dirty {
- // We don't need to modify go.mod from what we read previously.
+ if !dirty && cfg.CmdName != "mod tidy" {
+ // The go.mod file has the same semantic content that it had before
+ // (but not necessarily the same exact bytes).
// Ignore any intervening edits.
return
}
- unlock := modfetch.SideLock()
- defer unlock()
+ new, err := modFile.Format()
+ if err != nil {
+ base.Fatalf("go: %v", err)
+ }
+ defer func() {
+ // At this point we have determined to make the go.mod file on disk equal to new.
+ index = indexModFile(new, modFile, false)
+ }()
+
+ // Make a best-effort attempt to acquire the side lock, only to exclude
+ // previous versions of the 'go' command from making simultaneous edits.
+ if unlock, err := modfetch.SideLock(); err == nil {
+ defer unlock()
+ }
- file := filepath.Join(modRoot, "go.mod")
- old, err := renameio.ReadFile(file)
- if !bytes.Equal(old, modFileData) {
+ errNoChange := errors.New("no update needed")
+
+ err = lockedfile.Transform(ModFilePath(), func(old []byte) ([]byte, error) {
if bytes.Equal(old, new) {
- // Some other process wrote the same go.mod file that we were about to write.
- modFileData = new
- return
+ // The go.mod file is already equal to new, possibly as the result of some
+ // other process.
+ return nil, errNoChange
}
- if err != nil {
- base.Fatalf("go: can't determine whether go.mod has changed: %v", err)
+
+ if index != nil && !bytes.Equal(old, index.data) {
+ // The contents of the go.mod file have changed. In theory we could add all
+ // of the new modules to the build list, recompute, and check whether any
+ // module in *our* build list got bumped to a different version, but that's
+ // a lot of work for marginal benefit. Instead, fail the command: if users
+ // want to run concurrent commands, they need to start with a complete,
+ // consistent module definition.
+ return nil, fmt.Errorf("existing contents have changed since last read")
}
- // The contents of the go.mod file have changed. In theory we could add all
- // of the new modules to the build list, recompute, and check whether any
- // module in *our* build list got bumped to a different version, but that's
- // a lot of work for marginal benefit. Instead, fail the command: if users
- // want to run concurrent commands, they need to start with a complete,
- // consistent module definition.
- base.Fatalf("go: updates to go.mod needed, but contents have changed")
+ return new, nil
+ })
+
+ if err != nil && err != errNoChange {
+ base.Fatalf("go: updating go.mod: %v", err)
+ }
+}
+
+// indexModFile rebuilds the index of modFile.
+// If modFile has been changed since it was first read,
+// modFile.Cleanup must be called before indexModFile.
+func indexModFile(data []byte, modFile *modfile.File, needsFix bool) *modFileIndex {
+ i := new(modFileIndex)
+ i.data = data
+ i.dataNeedsFix = needsFix
+
+ i.module = module.Version{}
+ if modFile.Module != nil {
+ i.module = modFile.Module.Mod
+ }
+
+ i.goVersion = ""
+ if modFile.Go != nil {
+ i.goVersion = modFile.Go.Version
+ }
+
+ i.require = make(map[module.Version]requireMeta, len(modFile.Require))
+ for _, r := range modFile.Require {
+ i.require[r.Mod] = requireMeta{indirect: r.Indirect}
+ }
+
+ i.replace = make(map[module.Version]module.Version, len(modFile.Replace))
+ for _, r := range modFile.Replace {
+ if prev, dup := i.replace[r.Old]; dup && prev != r.New {
+ base.Fatalf("go: conflicting replacements for %v:\n\t%v\n\t%v", r.Old, prev, r.New)
+ }
+ i.replace[r.Old] = r.New
}
- if err := renameio.WriteFile(file, new, 0666); err != nil {
- base.Fatalf("error writing go.mod: %v", err)
+ i.exclude = make(map[module.Version]bool, len(modFile.Exclude))
+ for _, x := range modFile.Exclude {
+ i.exclude[x.Mod] = true
}
- modFileData = new
+
+ return i
}
-func fixVersion(path, vers string) (string, error) {
- // Special case: remove the old -gopkgin- hack.
- if strings.HasPrefix(path, "gopkg.in/") && strings.Contains(vers, "-gopkgin-") {
- vers = vers[strings.Index(vers, "-gopkgin-")+len("-gopkgin-"):]
+// modFileIsDirty reports whether the go.mod file differs meaningfully
+// from what was indexed.
+// If modFile has been changed (even cosmetically) since it was first read,
+// modFile.Cleanup must be called before modFileIsDirty.
+func (i *modFileIndex) modFileIsDirty(modFile *modfile.File) bool {
+ if i == nil {
+ return modFile != nil
+ }
+
+ if i.dataNeedsFix {
+ return true
}
- // fixVersion is called speculatively on every
- // module, version pair from every go.mod file.
- // Avoid the query if it looks OK.
- _, pathMajor, ok := module.SplitPathVersion(path)
- if !ok {
- return "", &module.ModuleError{
- Path: path,
- Err: &module.InvalidVersionError{
- Version: vers,
- Err: fmt.Errorf("malformed module path %q", path),
- },
+ if modFile.Module == nil {
+ if i.module != (module.Version{}) {
+ return true
}
+ } else if modFile.Module.Mod != i.module {
+ return true
}
- if vers != "" && module.CanonicalVersion(vers) == vers {
- if err := module.MatchPathMajor(vers, pathMajor); err == nil {
- return vers, nil
+
+ if modFile.Go == nil {
+ if i.goVersion != "" {
+ return true
+ }
+ } else if modFile.Go.Version != i.goVersion {
+ if i.goVersion == "" && cfg.BuildMod == "readonly" {
+ // go.mod files did not always require a 'go' version, so do not error out
+ // if one is missing — we may be inside an older module in the module
+ // cache, and should bias toward providing useful behavior.
+ } else {
+ return true
}
}
- info, err := Query(path, vers, "", nil)
- if err != nil {
- return "", err
+ if len(modFile.Require) != len(i.require) ||
+ len(modFile.Replace) != len(i.replace) ||
+ len(modFile.Exclude) != len(i.exclude) {
+ return true
+ }
+
+ for _, r := range modFile.Require {
+ if meta, ok := i.require[r.Mod]; !ok {
+ return true
+ } else if r.Indirect != meta.indirect {
+ if cfg.BuildMod == "readonly" {
+ // The module's requirements are consistent; only the "// indirect"
+ // comments that are wrong. But those are only guaranteed to be accurate
+ // after a "go mod tidy" — it's a good idea to run those before
+ // committing a change, but it's certainly not mandatory.
+ } else {
+ return true
+ }
+ }
+ }
+
+ for _, r := range modFile.Replace {
+ if r.New != i.replace[r.Old] {
+ return true
+ }
}
- return info.Version, nil
+
+ for _, x := range modFile.Exclude {
+ if !i.exclude[x.Mod] {
+ return true
+ }
+ }
+
+ return false
}
diff --git a/libgo/go/cmd/go/internal/modload/list.go b/libgo/go/cmd/go/internal/modload/list.go
index 35d0c28cde1..9400793bcb2 100644
--- a/libgo/go/cmd/go/internal/modload/list.go
+++ b/libgo/go/cmd/go/internal/modload/list.go
@@ -11,10 +11,12 @@ import (
"strings"
"cmd/go/internal/base"
+ "cmd/go/internal/cfg"
"cmd/go/internal/modinfo"
- "cmd/go/internal/module"
"cmd/go/internal/par"
"cmd/go/internal/search"
+
+ "golang.org/x/mod/module"
)
func ListModules(args []string, listU, listVersions bool) []*modinfo.ModulePublic {
@@ -55,6 +57,9 @@ func listModules(args []string, listVersions bool) []*modinfo.ModulePublic {
if search.IsRelativePath(arg) {
base.Fatalf("go: cannot use relative path %s to specify module", arg)
}
+ if !HasModRoot() && (arg == "all" || strings.Contains(arg, "...")) {
+ base.Fatalf("go: cannot match %q: working directory is not part of a module", arg)
+ }
if i := strings.Index(arg, "@"); i >= 0 {
path := arg[:i]
vers := arg[i+1:]
@@ -121,10 +126,20 @@ func listModules(args []string, listVersions bool) []*modinfo.ModulePublic {
}
continue
}
- mods = append(mods, &modinfo.ModulePublic{
- Path: arg,
- Error: modinfoError(arg, "", errors.New("not a known dependency")),
- })
+ if cfg.BuildMod == "vendor" {
+ // In vendor mode, we can't determine whether a missing module is “a
+ // known dependency” because the module graph is incomplete.
+ // Give a more explicit error message.
+ mods = append(mods, &modinfo.ModulePublic{
+ Path: arg,
+ Error: modinfoError(arg, "", errors.New("can't resolve module using the vendor directory\n\t(Use -mod=mod or -mod=readonly to bypass.)")),
+ })
+ } else {
+ mods = append(mods, &modinfo.ModulePublic{
+ Path: arg,
+ Error: modinfoError(arg, "", errors.New("not a known dependency")),
+ })
+ }
} else {
fmt.Fprintf(os.Stderr, "warning: pattern %q matched no module dependencies\n", arg)
}
diff --git a/libgo/go/cmd/go/internal/modload/load.go b/libgo/go/cmd/go/internal/modload/load.go
index d18723e7dcd..408c79022b4 100644
--- a/libgo/go/cmd/go/internal/modload/load.go
+++ b/libgo/go/cmd/go/internal/modload/load.go
@@ -22,13 +22,14 @@ import (
"cmd/go/internal/cfg"
"cmd/go/internal/imports"
"cmd/go/internal/modfetch"
- "cmd/go/internal/modfile"
- "cmd/go/internal/module"
"cmd/go/internal/mvs"
"cmd/go/internal/par"
"cmd/go/internal/search"
- "cmd/go/internal/semver"
"cmd/go/internal/str"
+
+ "golang.org/x/mod/modfile"
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
)
// buildList is the list of modules to use for building packages.
@@ -93,11 +94,11 @@ func ImportPathsQuiet(patterns []string, tags map[string]bool) []*search.Match {
pkgs := m.Pkgs
m.Pkgs = m.Pkgs[:0]
for _, pkg := range pkgs {
- dir := pkg
- if !filepath.IsAbs(dir) {
- dir = filepath.Join(cwd, pkg)
+ var dir string
+ if !filepath.IsAbs(pkg) {
+ dir = filepath.Join(base.Cwd, pkg)
} else {
- dir = filepath.Clean(dir)
+ dir = filepath.Clean(pkg)
}
// golang.org/issue/32917: We should resolve a relative path to a
@@ -211,11 +212,17 @@ func ImportPathsQuiet(patterns []string, tags map[string]bool) []*search.Match {
// One last pass to finalize wildcards.
updateMatches(matches, false)
+ checkMultiplePaths()
+ WriteGoMod()
+
+ return matches
+}
- // A given module path may be used as itself or as a replacement for another
- // module, but not both at the same time. Otherwise, the aliasing behavior is
- // too subtle (see https://golang.org/issue/26607), and we don't want to
- // commit to a specific behavior at this point.
+// checkMultiplePaths verifies that a given module path is used as itself
+// or as a replacement for another module, but not both at the same time.
+//
+// (See https://golang.org/issue/26607 and https://golang.org/issue/34650.)
+func checkMultiplePaths() {
firstPath := make(map[module.Version]string, len(buildList))
for _, mod := range buildList {
src := mod
@@ -229,9 +236,6 @@ func ImportPathsQuiet(patterns []string, tags map[string]bool) []*search.Match {
}
}
base.ExitIfErrors()
- WriteGoMod()
-
- return matches
}
// pathInModuleCache returns the import path of the directory dir,
@@ -318,7 +322,7 @@ func DirImportPath(dir string) string {
}
if !filepath.IsAbs(dir) {
- dir = filepath.Join(cwd, dir)
+ dir = filepath.Join(base.Cwd, dir)
} else {
dir = filepath.Clean(dir)
}
@@ -383,6 +387,7 @@ func loadAll(testAll bool) []string {
}
all := TargetPackages("...")
loaded.load(func() []string { return all })
+ checkMultiplePaths()
WriteGoMod()
var paths []string
@@ -401,6 +406,10 @@ func loadAll(testAll bool) []string {
// matching pattern, which may be relative to the working directory, under all
// build tag settings.
func TargetPackages(pattern string) []string {
+ // TargetPackages is relative to the main module, so ensure that the main
+ // module is a thing that can contain packages.
+ ModRoot()
+
return matchPackages(pattern, imports.AnyTags(), false, []module.Version{Target})
}
@@ -419,6 +428,37 @@ func SetBuildList(list []module.Version) {
buildList = append([]module.Version{}, list...)
}
+// TidyBuildList trims the build list to the minimal requirements needed to
+// retain the same versions of all packages from the preceding Load* or
+// ImportPaths* call.
+func TidyBuildList() {
+ used := map[module.Version]bool{Target: true}
+ for _, pkg := range loaded.pkgs {
+ used[pkg.mod] = true
+ }
+
+ keep := []module.Version{Target}
+ var direct []string
+ for _, m := range buildList[1:] {
+ if used[m] {
+ keep = append(keep, m)
+ if loaded.direct[m.Path] {
+ direct = append(direct, m.Path)
+ }
+ } else if cfg.BuildV {
+ if _, ok := index.require[m]; ok {
+ fmt.Fprintf(os.Stderr, "unused %s\n", m.Path)
+ }
+ }
+ }
+
+ min, err := mvs.Req(Target, direct, &mvsReqs{buildList: keep})
+ if err != nil {
+ base.Fatalf("go: %v", err)
+ }
+ buildList = append([]module.Version{Target}, min...)
+}
+
// ImportMap returns the actual package import path
// for an import path found in source code.
// If the given import path does not appear in the source code
@@ -621,6 +661,7 @@ func (ld *loader) load(roots func() []string) {
added[pkg.path] = true
numAdded++
if !haveMod[err.Module] {
+ fmt.Fprintf(os.Stderr, "go: found %s in %s %s\n", pkg.path, err.Module.Path, err.Module.Version)
haveMod[err.Module] = true
modAddedBy[err.Module] = pkg
buildList = append(buildList, err.Module)
@@ -960,21 +1001,15 @@ func WhyDepth(path string) int {
// If there is no replacement for mod, Replacement returns
// a module.Version with Path == "".
func Replacement(mod module.Version) module.Version {
- if modFile == nil {
- // Happens during testing and if invoking 'go get' or 'go list' outside a module.
- return module.Version{}
- }
-
- var found *modfile.Replace
- for _, r := range modFile.Replace {
- if r.Old.Path == mod.Path && (r.Old.Version == "" || r.Old.Version == mod.Version) {
- found = r // keep going
+ if index != nil {
+ if r, ok := index.replace[mod]; ok {
+ return r
+ }
+ if r, ok := index.replace[module.Version{Path: mod.Path}]; ok {
+ return r
}
}
- if found == nil {
- return module.Version{}
- }
- return found.New
+ return module.Version{}
}
// mvsReqs implements mvs.Reqs for module semantic versions,
@@ -1007,15 +1042,17 @@ func (r *mvsReqs) Required(mod module.Version) ([]module.Version, error) {
return cached{nil, err}
}
for i, mv := range list {
- for excluded[mv] {
- mv1, err := r.next(mv)
- if err != nil {
- return cached{nil, err}
- }
- if mv1.Version == "none" {
- return cached{nil, fmt.Errorf("%s(%s) depends on excluded %s(%s) with no newer version available", mod.Path, mod.Version, mv.Path, mv.Version)}
+ if index != nil {
+ for index.exclude[mv] {
+ mv1, err := r.next(mv)
+ if err != nil {
+ return cached{nil, err}
+ }
+ if mv1.Version == "none" {
+ return cached{nil, fmt.Errorf("%s(%s) depends on excluded %s(%s) with no newer version available", mod.Path, mod.Version, mv.Path, mv.Version)}
+ }
+ mv = mv1
}
- mv = mv1
}
list[i] = mv
}
@@ -1028,30 +1065,106 @@ func (r *mvsReqs) Required(mod module.Version) ([]module.Version, error) {
var vendorOnce sync.Once
+type vendorMetadata struct {
+ Explicit bool
+ Replacement module.Version
+}
+
var (
- vendorList []module.Version
- vendorMap map[string]module.Version
+ vendorList []module.Version // modules that contribute packages to the build, in order of appearance
+ vendorReplaced []module.Version // all replaced modules; may or may not also contribute packages
+ vendorVersion map[string]string // module path → selected version (if known)
+ vendorPkgModule map[string]module.Version // package → containing module
+ vendorMeta map[module.Version]vendorMetadata
)
// readVendorList reads the list of vendored modules from vendor/modules.txt.
func readVendorList() {
vendorOnce.Do(func() {
vendorList = nil
- vendorMap = make(map[string]module.Version)
- data, _ := ioutil.ReadFile(filepath.Join(ModRoot(), "vendor/modules.txt"))
- var m module.Version
+ vendorPkgModule = make(map[string]module.Version)
+ vendorVersion = make(map[string]string)
+ vendorMeta = make(map[module.Version]vendorMetadata)
+ data, err := ioutil.ReadFile(filepath.Join(ModRoot(), "vendor/modules.txt"))
+ if err != nil {
+ if !errors.Is(err, os.ErrNotExist) {
+ base.Fatalf("go: %s", err)
+ }
+ return
+ }
+
+ var mod module.Version
for _, line := range strings.Split(string(data), "\n") {
if strings.HasPrefix(line, "# ") {
f := strings.Fields(line)
- m = module.Version{}
- if len(f) == 3 && semver.IsValid(f[2]) {
- m = module.Version{Path: f[1], Version: f[2]}
- vendorList = append(vendorList, m)
+
+ if len(f) < 3 {
+ continue
}
- } else if m.Path != "" {
- f := strings.Fields(line)
- if len(f) == 1 {
- vendorMap[f[0]] = m
+ if semver.IsValid(f[2]) {
+ // A module, but we don't yet know whether it is in the build list or
+ // only included to indicate a replacement.
+ mod = module.Version{Path: f[1], Version: f[2]}
+ f = f[3:]
+ } else if f[2] == "=>" {
+ // A wildcard replacement found in the main module's go.mod file.
+ mod = module.Version{Path: f[1]}
+ f = f[2:]
+ } else {
+ // Not a version or a wildcard replacement.
+ // We don't know how to interpret this module line, so ignore it.
+ mod = module.Version{}
+ continue
+ }
+
+ if len(f) >= 2 && f[0] == "=>" {
+ meta := vendorMeta[mod]
+ if len(f) == 2 {
+ // File replacement.
+ meta.Replacement = module.Version{Path: f[1]}
+ vendorReplaced = append(vendorReplaced, mod)
+ } else if len(f) == 3 && semver.IsValid(f[2]) {
+ // Path and version replacement.
+ meta.Replacement = module.Version{Path: f[1], Version: f[2]}
+ vendorReplaced = append(vendorReplaced, mod)
+ } else {
+ // We don't understand this replacement. Ignore it.
+ }
+ vendorMeta[mod] = meta
+ }
+ continue
+ }
+
+ // Not a module line. Must be a package within a module or a metadata
+ // directive, either of which requires a preceding module line.
+ if mod.Path == "" {
+ continue
+ }
+
+ if strings.HasPrefix(line, "## ") {
+ // Metadata. Take the union of annotations across multiple lines, if present.
+ meta := vendorMeta[mod]
+ for _, entry := range strings.Split(strings.TrimPrefix(line, "## "), ";") {
+ entry = strings.TrimSpace(entry)
+ if entry == "explicit" {
+ meta.Explicit = true
+ }
+ // All other tokens are reserved for future use.
+ }
+ vendorMeta[mod] = meta
+ continue
+ }
+
+ if f := strings.Fields(line); len(f) == 1 && module.CheckImportPath(f[0]) == nil {
+ // A package within the current module.
+ vendorPkgModule[f[0]] = mod
+
+ // Since this module provides a package for the build, we know that it
+ // is in the build list and is the selected version of its path.
+ // If this information is new, record it.
+ if v, ok := vendorVersion[mod.Path]; !ok || semver.Compare(v, mod.Version) < 0 {
+ vendorList = append(vendorList, mod)
+ vendorVersion[mod.Path] = mod.Version
}
}
}
@@ -1082,19 +1195,6 @@ func (r *mvsReqs) required(mod module.Version) ([]module.Version, error) {
return append([]module.Version(nil), vendorList...), nil
}
- if targetInGorootSrc {
- // When inside "std" or "cmd", only fetch and read go.mod files if we're
- // explicitly running a command that can change the module graph. If we have
- // to resolve a new dependency, we might pick the wrong version, but 'go mod
- // tidy' will fix it — and new standard-library dependencies should be rare
- // anyway.
- //
- // TODO(golang.org/issue/30240): Drop this special-case.
- if cfg.CmdName != "get" && !strings.HasPrefix(cfg.CmdName, "mod ") {
- return nil, nil
- }
- }
-
origPath := mod.Path
if repl := Replacement(mod); repl.Path != "" {
if repl.Version == "" {
@@ -1209,6 +1309,11 @@ func (*mvsReqs) next(m module.Version) (module.Version, error) {
return module.Version{Path: m.Path, Version: "none"}, nil
}
+// fetch downloads the given module (or its replacement)
+// and returns its location.
+//
+// The isLocal return value reports whether the replacement,
+// if any, is local to the filesystem.
func fetch(mod module.Version) (dir string, isLocal bool, err error) {
if mod == Target {
return ModRoot(), true, nil
diff --git a/libgo/go/cmd/go/internal/modload/query.go b/libgo/go/cmd/go/internal/modload/query.go
index 602bf47275d..53278b91002 100644
--- a/libgo/go/cmd/go/internal/modload/query.go
+++ b/libgo/go/cmd/go/internal/modload/query.go
@@ -9,15 +9,18 @@ import (
"fmt"
"os"
pathpkg "path"
+ "path/filepath"
"strings"
"sync"
+ "cmd/go/internal/cfg"
"cmd/go/internal/imports"
"cmd/go/internal/modfetch"
- "cmd/go/internal/module"
"cmd/go/internal/search"
- "cmd/go/internal/semver"
"cmd/go/internal/str"
+
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
)
// Query looks up a revision of a given module given a version query string.
@@ -61,10 +64,24 @@ func Query(path, query, current string, allowed func(module.Version) bool) (*mod
return info, err
}
+var errQueryDisabled error = queryDisabledError{}
+
+type queryDisabledError struct{}
+
+func (queryDisabledError) Error() string {
+ if cfg.BuildModReason == "" {
+ return fmt.Sprintf("cannot query module due to -mod=%s", cfg.BuildMod)
+ }
+ return fmt.Sprintf("cannot query module due to -mod=%s\n\t(%s)", cfg.BuildMod, cfg.BuildModReason)
+}
+
func queryProxy(proxy, path, query, current string, allowed func(module.Version) bool) (*modfetch.RevInfo, error) {
if current != "" && !semver.IsValid(current) {
return nil, fmt.Errorf("invalid previous version %q", current)
}
+ if cfg.BuildMod != "" && cfg.BuildMod != "mod" {
+ return nil, errQueryDisabled
+ }
if allowed == nil {
allowed = func(module.Version) bool { return true }
}
@@ -74,10 +91,20 @@ func queryProxy(proxy, path, query, current string, allowed func(module.Version)
badVersion := func(v string) (*modfetch.RevInfo, error) {
return nil, fmt.Errorf("invalid semantic version %q in range %q", v, query)
}
- var ok func(module.Version) bool
- var prefix string
- var preferOlder bool
- var mayUseLatest bool
+ matchesMajor := func(v string) bool {
+ _, pathMajor, ok := module.SplitPathVersion(path)
+ if !ok {
+ return false
+ }
+ return module.CheckPathMajor(v, pathMajor) == nil
+ }
+ var (
+ ok func(module.Version) bool
+ prefix string
+ preferOlder bool
+ mayUseLatest bool
+ preferIncompatible bool = strings.HasSuffix(current, "+incompatible")
+ )
switch {
case query == "latest":
ok = allowed
@@ -110,6 +137,9 @@ func queryProxy(proxy, path, query, current string, allowed func(module.Version)
ok = func(m module.Version) bool {
return semver.Compare(m.Version, v) <= 0 && allowed(m)
}
+ if !matchesMajor(v) {
+ preferIncompatible = true
+ }
case strings.HasPrefix(query, "<"):
v := query[len("<"):]
@@ -119,6 +149,9 @@ func queryProxy(proxy, path, query, current string, allowed func(module.Version)
ok = func(m module.Version) bool {
return semver.Compare(m.Version, v) < 0 && allowed(m)
}
+ if !matchesMajor(v) {
+ preferIncompatible = true
+ }
case strings.HasPrefix(query, ">="):
v := query[len(">="):]
@@ -129,6 +162,9 @@ func queryProxy(proxy, path, query, current string, allowed func(module.Version)
return semver.Compare(m.Version, v) >= 0 && allowed(m)
}
preferOlder = true
+ if !matchesMajor(v) {
+ preferIncompatible = true
+ }
case strings.HasPrefix(query, ">"):
v := query[len(">"):]
@@ -143,12 +179,18 @@ func queryProxy(proxy, path, query, current string, allowed func(module.Version)
return semver.Compare(m.Version, v) > 0 && allowed(m)
}
preferOlder = true
+ if !matchesMajor(v) {
+ preferIncompatible = true
+ }
case semver.IsValid(query) && isSemverPrefix(query):
ok = func(m module.Version) bool {
return matchSemverPrefix(query, m.Version) && allowed(m)
}
prefix = query + "."
+ if !matchesMajor(query) {
+ preferIncompatible = true
+ }
default:
// Direct lookup of semantic version or commit identifier.
@@ -201,6 +243,10 @@ func queryProxy(proxy, path, query, current string, allowed func(module.Version)
if err != nil {
return nil, err
}
+ releases, prereleases, err := filterVersions(path, versions, ok, preferIncompatible)
+ if err != nil {
+ return nil, err
+ }
lookup := func(v string) (*modfetch.RevInfo, error) {
rev, err := repo.Stat(v)
@@ -221,28 +267,18 @@ func queryProxy(proxy, path, query, current string, allowed func(module.Version)
}
if preferOlder {
- for _, v := range versions {
- if semver.Prerelease(v) == "" && ok(module.Version{Path: path, Version: v}) {
- return lookup(v)
- }
+ if len(releases) > 0 {
+ return lookup(releases[0])
}
- for _, v := range versions {
- if semver.Prerelease(v) != "" && ok(module.Version{Path: path, Version: v}) {
- return lookup(v)
- }
+ if len(prereleases) > 0 {
+ return lookup(prereleases[0])
}
} else {
- for i := len(versions) - 1; i >= 0; i-- {
- v := versions[i]
- if semver.Prerelease(v) == "" && ok(module.Version{Path: path, Version: v}) {
- return lookup(v)
- }
+ if len(releases) > 0 {
+ return lookup(releases[len(releases)-1])
}
- for i := len(versions) - 1; i >= 0; i-- {
- v := versions[i]
- if semver.Prerelease(v) != "" && ok(module.Version{Path: path, Version: v}) {
- return lookup(v)
- }
+ if len(prereleases) > 0 {
+ return lookup(prereleases[len(prereleases)-1])
}
}
@@ -286,6 +322,52 @@ func matchSemverPrefix(p, v string) bool {
return len(v) > len(p) && v[len(p)] == '.' && v[:len(p)] == p && semver.Prerelease(v) == ""
}
+// filterVersions classifies versions into releases and pre-releases, filtering
+// out:
+// 1. versions that do not satisfy the 'ok' predicate, and
+// 2. "+incompatible" versions, if a compatible one satisfies the predicate
+// and the incompatible version is not preferred.
+func filterVersions(path string, versions []string, ok func(module.Version) bool, preferIncompatible bool) (releases, prereleases []string, err error) {
+ var lastCompatible string
+ for _, v := range versions {
+ if !ok(module.Version{Path: path, Version: v}) {
+ continue
+ }
+
+ if !preferIncompatible {
+ if !strings.HasSuffix(v, "+incompatible") {
+ lastCompatible = v
+ } else if lastCompatible != "" {
+ // If the latest compatible version is allowed and has a go.mod file,
+ // ignore any version with a higher (+incompatible) major version. (See
+ // https://golang.org/issue/34165.) Note that we even prefer a
+ // compatible pre-release over an incompatible release.
+
+ ok, err := versionHasGoMod(module.Version{Path: path, Version: lastCompatible})
+ if err != nil {
+ return nil, nil, err
+ }
+ if ok {
+ break
+ }
+
+ // No acceptable compatible release has a go.mod file, so the versioning
+ // for the module might not be module-aware, and we should respect
+ // legacy major-version tags.
+ preferIncompatible = true
+ }
+ }
+
+ if semver.Prerelease(v) != "" {
+ prereleases = append(prereleases, v)
+ } else {
+ releases = append(releases, v)
+ }
+ }
+
+ return releases, prereleases, nil
+}
+
type QueryResult struct {
Mod module.Version
Rev *modfetch.RevInfo
@@ -381,9 +463,10 @@ func QueryPattern(pattern, query string, allowed func(module.Version) bool) ([]Q
r.Packages = match(r.Mod, root, isLocal)
if len(r.Packages) == 0 {
return r, &PackageNotInModuleError{
- Mod: r.Mod,
- Query: query,
- Pattern: pattern,
+ Mod: r.Mod,
+ Replacement: Replacement(r.Mod),
+ Query: query,
+ Pattern: pattern,
}
}
return r, nil
@@ -471,7 +554,17 @@ func queryPrefixModules(candidateModules []string, queryModule func(path string)
notExistErr = rErr
}
} else if err == nil {
- err = r.err
+ if len(found) > 0 || noPackage != nil {
+ // golang.org/issue/34094: If we have already found a module that
+ // could potentially contain the target package, ignore unclassified
+ // errors for modules with shorter paths.
+
+ // golang.org/issue/34383 is a special case of this: if we have
+ // already found example.com/foo/v2@v2.0.0 with a matching go.mod
+ // file, ignore the error from example.com/foo@v2.0.0.
+ } else {
+ err = r.err
+ }
}
}
}
@@ -526,21 +619,32 @@ func (e *NoMatchingVersionError) Error() string {
// code for the versions it knows about, and thus did not have the opportunity
// to return a non-400 status code to suppress fallback.
type PackageNotInModuleError struct {
- Mod module.Version
- Query string
- Pattern string
+ Mod module.Version
+ Replacement module.Version
+ Query string
+ Pattern string
}
func (e *PackageNotInModuleError) Error() string {
found := ""
- if e.Query != e.Mod.Version {
+ if r := e.Replacement; r.Path != "" {
+ replacement := r.Path
+ if r.Version != "" {
+ replacement = fmt.Sprintf("%s@%s", r.Path, r.Version)
+ }
+ if e.Query == e.Mod.Version {
+ found = fmt.Sprintf(" (replaced by %s)", replacement)
+ } else {
+ found = fmt.Sprintf(" (%s, replaced by %s)", e.Mod.Version, replacement)
+ }
+ } else if e.Query != e.Mod.Version {
found = fmt.Sprintf(" (%s)", e.Mod.Version)
}
if strings.Contains(e.Pattern, "...") {
- return fmt.Sprintf("module %s@%s%s found, but does not contain packages matching %s", e.Mod.Path, e.Query, found, e.Pattern)
+ return fmt.Sprintf("module %s@%s found%s, but does not contain packages matching %s", e.Mod.Path, e.Query, found, e.Pattern)
}
- return fmt.Sprintf("module %s@%s%s found, but does not contain package %s", e.Mod.Path, e.Query, found, e.Pattern)
+ return fmt.Sprintf("module %s@%s found%s, but does not contain package %s", e.Mod.Path, e.Query, found, e.Pattern)
}
// ModuleHasRootPackage returns whether module m contains a package m.Path.
@@ -552,3 +656,12 @@ func ModuleHasRootPackage(m module.Version) (bool, error) {
_, ok := dirInModule(m.Path, m.Path, root, isLocal)
return ok, nil
}
+
+func versionHasGoMod(m module.Version) (bool, error) {
+ root, _, err := fetch(m)
+ if err != nil {
+ return false, err
+ }
+ fi, err := os.Stat(filepath.Join(root, "go.mod"))
+ return err == nil && !fi.IsDir(), nil
+}
diff --git a/libgo/go/cmd/go/internal/modload/query_test.go b/libgo/go/cmd/go/internal/modload/query_test.go
index b91cbb5a700..9c91c05e5f8 100644
--- a/libgo/go/cmd/go/internal/modload/query_test.go
+++ b/libgo/go/cmd/go/internal/modload/query_test.go
@@ -17,7 +17,8 @@ import (
"cmd/go/internal/cfg"
"cmd/go/internal/modfetch"
"cmd/go/internal/modfetch/codehost"
- "cmd/go/internal/module"
+
+ "golang.org/x/mod/module"
)
func TestMain(m *testing.M) {
diff --git a/libgo/go/cmd/go/internal/modload/search.go b/libgo/go/cmd/go/internal/modload/search.go
index d82386eca30..a303f51858a 100644
--- a/libgo/go/cmd/go/internal/modload/search.go
+++ b/libgo/go/cmd/go/internal/modload/search.go
@@ -13,8 +13,9 @@ import (
"cmd/go/internal/base"
"cmd/go/internal/cfg"
"cmd/go/internal/imports"
- "cmd/go/internal/module"
"cmd/go/internal/search"
+
+ "golang.org/x/mod/module"
)
// matchPackages returns a list of packages in the list of modules
@@ -48,16 +49,20 @@ func matchPackages(pattern string, tags map[string]bool, useStd bool, modules []
return nil
}
- // Don't use GOROOT/src but do walk down into it.
- if path == root && importPathRoot == "" {
- return nil
- }
-
want := true
- // Avoid .foo, _foo, and testdata directory trees.
- _, elem := filepath.Split(path)
- if strings.HasPrefix(elem, ".") || strings.HasPrefix(elem, "_") || elem == "testdata" {
- want = false
+ elem := ""
+
+ // Don't use GOROOT/src but do walk down into it.
+ if path == root {
+ if importPathRoot == "" {
+ return nil
+ }
+ } else {
+ // Avoid .foo, _foo, and testdata subdirectory trees.
+ _, elem = filepath.Split(path)
+ if strings.HasPrefix(elem, ".") || strings.HasPrefix(elem, "_") || elem == "testdata" {
+ want = false
+ }
}
name := importPathRoot + filepath.ToSlash(path[len(root):])
diff --git a/libgo/go/cmd/go/internal/modload/stat_openfile.go b/libgo/go/cmd/go/internal/modload/stat_openfile.go
new file mode 100644
index 00000000000..931aaf1577b
--- /dev/null
+++ b/libgo/go/cmd/go/internal/modload/stat_openfile.go
@@ -0,0 +1,27 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build aix js,wasm plan9
+
+// On plan9, per http://9p.io/magic/man2html/2/access: “Since file permissions
+// are checked by the server and group information is not known to the client,
+// access must open the file to check permissions.”
+//
+// aix and js,wasm are similar, in that they do not define syscall.Access.
+
+package modload
+
+import (
+ "os"
+)
+
+// hasWritePerm reports whether the current user has permission to write to the
+// file with the given info.
+func hasWritePerm(path string, _ os.FileInfo) bool {
+ if f, err := os.OpenFile(path, os.O_WRONLY, 0); err == nil {
+ f.Close()
+ return true
+ }
+ return false
+}
diff --git a/libgo/go/cmd/go/internal/modload/stat_unix.go b/libgo/go/cmd/go/internal/modload/stat_unix.go
new file mode 100644
index 00000000000..a53d17e93a8
--- /dev/null
+++ b/libgo/go/cmd/go/internal/modload/stat_unix.go
@@ -0,0 +1,31 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin dragonfly freebsd hurd linux netbsd openbsd solaris
+
+package modload
+
+import (
+ "os"
+ "syscall"
+)
+
+// hasWritePerm reports whether the current user has permission to write to the
+// file with the given info.
+//
+// Although the root user on most Unix systems can write to files even without
+// permission, hasWritePerm reports false if no appropriate permission bit is
+// set even if the current user is root.
+func hasWritePerm(path string, fi os.FileInfo) bool {
+ if os.Getuid() == 0 {
+ // The root user can access any file, but we still want to default to
+ // read-only mode if the go.mod file is marked as globally non-writable.
+ // (If the user really intends not to be in readonly mode, they can
+ // pass -mod=mod explicitly.)
+ return fi.Mode()&0222 != 0
+ }
+
+ const W_OK = 0x2
+ return syscall.Access(path, W_OK) == nil
+}
diff --git a/libgo/go/cmd/go/internal/modload/stat_windows.go b/libgo/go/cmd/go/internal/modload/stat_windows.go
new file mode 100644
index 00000000000..d7826cfc6b8
--- /dev/null
+++ b/libgo/go/cmd/go/internal/modload/stat_windows.go
@@ -0,0 +1,23 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build windows
+
+package modload
+
+import (
+ "os"
+)
+
+// hasWritePerm reports whether the current user has permission to write to the
+// file with the given info.
+func hasWritePerm(_ string, fi os.FileInfo) bool {
+ // Windows has a read-only attribute independent of ACLs, so use that to
+ // determine whether the file is intended to be overwritten.
+ //
+ // Per https://golang.org/pkg/os/#Chmod:
+ // “On Windows, only the 0200 bit (owner writable) of mode is used; it
+ // controls whether the file's read-only attribute is set or cleared.”
+ return fi.Mode()&0200 != 0
+}
diff --git a/libgo/go/cmd/go/internal/modload/testgo.go b/libgo/go/cmd/go/internal/modload/testgo.go
index 663b24a68d7..6b34f5be393 100644
--- a/libgo/go/cmd/go/internal/modload/testgo.go
+++ b/libgo/go/cmd/go/internal/modload/testgo.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//+build testgo
+// +build testgo
package modload
diff --git a/libgo/go/cmd/go/internal/module/module.go b/libgo/go/cmd/go/internal/module/module.go
deleted file mode 100644
index 3e0baba15b3..00000000000
--- a/libgo/go/cmd/go/internal/module/module.go
+++ /dev/null
@@ -1,632 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package module defines the module.Version type
-// along with support code.
-package module
-
-// IMPORTANT NOTE
-//
-// This file essentially defines the set of valid import paths for the go command.
-// There are many subtle considerations, including Unicode ambiguity,
-// security, network, and file system representations.
-//
-// This file also defines the set of valid module path and version combinations,
-// another topic with many subtle considerations.
-//
-// Changes to the semantics in this file require approval from rsc.
-
-import (
- "errors"
- "fmt"
- "sort"
- "strings"
- "unicode"
- "unicode/utf8"
-
- "cmd/go/internal/semver"
-)
-
-// A Version is defined by a module path and version pair.
-type Version struct {
- Path string
-
- // Version is usually a semantic version in canonical form.
- // There are two exceptions to this general rule.
- // First, the top-level target of a build has no specific version
- // and uses Version = "".
- // Second, during MVS calculations the version "none" is used
- // to represent the decision to take no version of a given module.
- Version string `json:",omitempty"`
-}
-
-// A ModuleError indicates an error specific to a module.
-type ModuleError struct {
- Path string
- Version string
- Err error
-}
-
-// VersionError returns a ModuleError derived from a Version and error.
-func VersionError(v Version, err error) error {
- return &ModuleError{
- Path: v.Path,
- Version: v.Version,
- Err: err,
- }
-}
-
-func (e *ModuleError) Error() string {
- if v, ok := e.Err.(*InvalidVersionError); ok {
- return fmt.Sprintf("%s@%s: invalid %s: %v", e.Path, v.Version, v.noun(), v.Err)
- }
- if e.Version != "" {
- return fmt.Sprintf("%s@%s: %v", e.Path, e.Version, e.Err)
- }
- return fmt.Sprintf("module %s: %v", e.Path, e.Err)
-}
-
-func (e *ModuleError) Unwrap() error { return e.Err }
-
-// An InvalidVersionError indicates an error specific to a version, with the
-// module path unknown or specified externally.
-//
-// A ModuleError may wrap an InvalidVersionError, but an InvalidVersionError
-// must not wrap a ModuleError.
-type InvalidVersionError struct {
- Version string
- Pseudo bool
- Err error
-}
-
-// noun returns either "version" or "pseudo-version", depending on whether
-// e.Version is a pseudo-version.
-func (e *InvalidVersionError) noun() string {
- if e.Pseudo {
- return "pseudo-version"
- }
- return "version"
-}
-
-func (e *InvalidVersionError) Error() string {
- return fmt.Sprintf("%s %q invalid: %s", e.noun(), e.Version, e.Err)
-}
-
-func (e *InvalidVersionError) Unwrap() error { return e.Err }
-
-// Check checks that a given module path, version pair is valid.
-// In addition to the path being a valid module path
-// and the version being a valid semantic version,
-// the two must correspond.
-// For example, the path "yaml/v2" only corresponds to
-// semantic versions beginning with "v2.".
-func Check(path, version string) error {
- if err := CheckPath(path); err != nil {
- return err
- }
- if !semver.IsValid(version) {
- return &ModuleError{
- Path: path,
- Err: &InvalidVersionError{Version: version, Err: errors.New("not a semantic version")},
- }
- }
- _, pathMajor, _ := SplitPathVersion(path)
- if err := MatchPathMajor(version, pathMajor); err != nil {
- return &ModuleError{Path: path, Err: err}
- }
- return nil
-}
-
-// firstPathOK reports whether r can appear in the first element of a module path.
-// The first element of the path must be an LDH domain name, at least for now.
-// To avoid case ambiguity, the domain name must be entirely lower case.
-func firstPathOK(r rune) bool {
- return r == '-' || r == '.' ||
- '0' <= r && r <= '9' ||
- 'a' <= r && r <= 'z'
-}
-
-// pathOK reports whether r can appear in an import path element.
-// Paths can be ASCII letters, ASCII digits, and limited ASCII punctuation: + - . _ and ~.
-// This matches what "go get" has historically recognized in import paths.
-// TODO(rsc): We would like to allow Unicode letters, but that requires additional
-// care in the safe encoding (see note below).
-func pathOK(r rune) bool {
- if r < utf8.RuneSelf {
- return r == '+' || r == '-' || r == '.' || r == '_' || r == '~' ||
- '0' <= r && r <= '9' ||
- 'A' <= r && r <= 'Z' ||
- 'a' <= r && r <= 'z'
- }
- return false
-}
-
-// fileNameOK reports whether r can appear in a file name.
-// For now we allow all Unicode letters but otherwise limit to pathOK plus a few more punctuation characters.
-// If we expand the set of allowed characters here, we have to
-// work harder at detecting potential case-folding and normalization collisions.
-// See note about "safe encoding" below.
-func fileNameOK(r rune) bool {
- if r < utf8.RuneSelf {
- // Entire set of ASCII punctuation, from which we remove characters:
- // ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
- // We disallow some shell special characters: " ' * < > ? ` |
- // (Note that some of those are disallowed by the Windows file system as well.)
- // We also disallow path separators / : and \ (fileNameOK is only called on path element characters).
- // We allow spaces (U+0020) in file names.
- const allowed = "!#$%&()+,-.=@[]^_{}~ "
- if '0' <= r && r <= '9' || 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' {
- return true
- }
- for i := 0; i < len(allowed); i++ {
- if rune(allowed[i]) == r {
- return true
- }
- }
- return false
- }
- // It may be OK to add more ASCII punctuation here, but only carefully.
- // For example Windows disallows < > \, and macOS disallows :, so we must not allow those.
- return unicode.IsLetter(r)
-}
-
-// CheckPath checks that a module path is valid.
-func CheckPath(path string) error {
- if err := checkPath(path, false); err != nil {
- return fmt.Errorf("malformed module path %q: %v", path, err)
- }
- i := strings.Index(path, "/")
- if i < 0 {
- i = len(path)
- }
- if i == 0 {
- return fmt.Errorf("malformed module path %q: leading slash", path)
- }
- if !strings.Contains(path[:i], ".") {
- return fmt.Errorf("malformed module path %q: missing dot in first path element", path)
- }
- if path[0] == '-' {
- return fmt.Errorf("malformed module path %q: leading dash in first path element", path)
- }
- for _, r := range path[:i] {
- if !firstPathOK(r) {
- return fmt.Errorf("malformed module path %q: invalid char %q in first path element", path, r)
- }
- }
- if _, _, ok := SplitPathVersion(path); !ok {
- return fmt.Errorf("malformed module path %q: invalid version", path)
- }
- return nil
-}
-
-// CheckImportPath checks that an import path is valid.
-func CheckImportPath(path string) error {
- if err := checkPath(path, false); err != nil {
- return fmt.Errorf("malformed import path %q: %v", path, err)
- }
- return nil
-}
-
-// checkPath checks that a general path is valid.
-// It returns an error describing why but not mentioning path.
-// Because these checks apply to both module paths and import paths,
-// the caller is expected to add the "malformed ___ path %q: " prefix.
-// fileName indicates whether the final element of the path is a file name
-// (as opposed to a directory name).
-func checkPath(path string, fileName bool) error {
- if !utf8.ValidString(path) {
- return fmt.Errorf("invalid UTF-8")
- }
- if path == "" {
- return fmt.Errorf("empty string")
- }
- if path[0] == '-' {
- return fmt.Errorf("leading dash")
- }
- if strings.Contains(path, "..") {
- return fmt.Errorf("double dot")
- }
- if strings.Contains(path, "//") {
- return fmt.Errorf("double slash")
- }
- if path[len(path)-1] == '/' {
- return fmt.Errorf("trailing slash")
- }
- elemStart := 0
- for i, r := range path {
- if r == '/' {
- if err := checkElem(path[elemStart:i], fileName); err != nil {
- return err
- }
- elemStart = i + 1
- }
- }
- if err := checkElem(path[elemStart:], fileName); err != nil {
- return err
- }
- return nil
-}
-
-// checkElem checks whether an individual path element is valid.
-// fileName indicates whether the element is a file name (not a directory name).
-func checkElem(elem string, fileName bool) error {
- if elem == "" {
- return fmt.Errorf("empty path element")
- }
- if strings.Count(elem, ".") == len(elem) {
- return fmt.Errorf("invalid path element %q", elem)
- }
- if elem[0] == '.' && !fileName {
- return fmt.Errorf("leading dot in path element")
- }
- if elem[len(elem)-1] == '.' {
- return fmt.Errorf("trailing dot in path element")
- }
- charOK := pathOK
- if fileName {
- charOK = fileNameOK
- }
- for _, r := range elem {
- if !charOK(r) {
- return fmt.Errorf("invalid char %q", r)
- }
- }
-
- // Windows disallows a bunch of path elements, sadly.
- // See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file
- short := elem
- if i := strings.Index(short, "."); i >= 0 {
- short = short[:i]
- }
- for _, bad := range badWindowsNames {
- if strings.EqualFold(bad, short) {
- return fmt.Errorf("%q disallowed as path element component on Windows", short)
- }
- }
- return nil
-}
-
-// CheckFilePath checks whether a slash-separated file path is valid.
-func CheckFilePath(path string) error {
- if err := checkPath(path, true); err != nil {
- return fmt.Errorf("malformed file path %q: %v", path, err)
- }
- return nil
-}
-
-// badWindowsNames are the reserved file path elements on Windows.
-// See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file
-var badWindowsNames = []string{
- "CON",
- "PRN",
- "AUX",
- "NUL",
- "COM1",
- "COM2",
- "COM3",
- "COM4",
- "COM5",
- "COM6",
- "COM7",
- "COM8",
- "COM9",
- "LPT1",
- "LPT2",
- "LPT3",
- "LPT4",
- "LPT5",
- "LPT6",
- "LPT7",
- "LPT8",
- "LPT9",
-}
-
-// SplitPathVersion returns prefix and major version such that prefix+pathMajor == path
-// and version is either empty or "/vN" for N >= 2.
-// As a special case, gopkg.in paths are recognized directly;
-// they require ".vN" instead of "/vN", and for all N, not just N >= 2.
-func SplitPathVersion(path string) (prefix, pathMajor string, ok bool) {
- if strings.HasPrefix(path, "gopkg.in/") {
- return splitGopkgIn(path)
- }
-
- i := len(path)
- dot := false
- for i > 0 && ('0' <= path[i-1] && path[i-1] <= '9' || path[i-1] == '.') {
- if path[i-1] == '.' {
- dot = true
- }
- i--
- }
- if i <= 1 || i == len(path) || path[i-1] != 'v' || path[i-2] != '/' {
- return path, "", true
- }
- prefix, pathMajor = path[:i-2], path[i-2:]
- if dot || len(pathMajor) <= 2 || pathMajor[2] == '0' || pathMajor == "/v1" {
- return path, "", false
- }
- return prefix, pathMajor, true
-}
-
-// splitGopkgIn is like SplitPathVersion but only for gopkg.in paths.
-func splitGopkgIn(path string) (prefix, pathMajor string, ok bool) {
- if !strings.HasPrefix(path, "gopkg.in/") {
- return path, "", false
- }
- i := len(path)
- if strings.HasSuffix(path, "-unstable") {
- i -= len("-unstable")
- }
- for i > 0 && ('0' <= path[i-1] && path[i-1] <= '9') {
- i--
- }
- if i <= 1 || path[i-1] != 'v' || path[i-2] != '.' {
- // All gopkg.in paths must end in vN for some N.
- return path, "", false
- }
- prefix, pathMajor = path[:i-2], path[i-2:]
- if len(pathMajor) <= 2 || pathMajor[2] == '0' && pathMajor != ".v0" {
- return path, "", false
- }
- return prefix, pathMajor, true
-}
-
-// MatchPathMajor returns a non-nil error if the semantic version v
-// does not match the path major version pathMajor.
-func MatchPathMajor(v, pathMajor string) error {
- if strings.HasPrefix(pathMajor, ".v") && strings.HasSuffix(pathMajor, "-unstable") {
- pathMajor = strings.TrimSuffix(pathMajor, "-unstable")
- }
- if strings.HasPrefix(v, "v0.0.0-") && pathMajor == ".v1" {
- // Allow old bug in pseudo-versions that generated v0.0.0- pseudoversion for gopkg .v1.
- // For example, gopkg.in/yaml.v2@v2.2.1's go.mod requires gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405.
- return nil
- }
- m := semver.Major(v)
- if pathMajor == "" {
- if m == "v0" || m == "v1" || semver.Build(v) == "+incompatible" {
- return nil
- }
- pathMajor = "v0 or v1"
- } else if pathMajor[0] == '/' || pathMajor[0] == '.' {
- if m == pathMajor[1:] {
- return nil
- }
- pathMajor = pathMajor[1:]
- }
- return &InvalidVersionError{
- Version: v,
- Err: fmt.Errorf("should be %s, not %s", pathMajor, semver.Major(v)),
- }
-}
-
-// PathMajorPrefix returns the major-version tag prefix implied by pathMajor.
-// An empty PathMajorPrefix allows either v0 or v1.
-//
-// Note that MatchPathMajor may accept some versions that do not actually begin
-// with this prefix: namely, it accepts a 'v0.0.0-' prefix for a '.v1'
-// pathMajor, even though that pathMajor implies 'v1' tagging.
-func PathMajorPrefix(pathMajor string) string {
- if pathMajor == "" {
- return ""
- }
- if pathMajor[0] != '/' && pathMajor[0] != '.' {
- panic("pathMajor suffix " + pathMajor + " passed to PathMajorPrefix lacks separator")
- }
- if strings.HasPrefix(pathMajor, ".v") && strings.HasSuffix(pathMajor, "-unstable") {
- pathMajor = strings.TrimSuffix(pathMajor, "-unstable")
- }
- m := pathMajor[1:]
- if m != semver.Major(m) {
- panic("pathMajor suffix " + pathMajor + "passed to PathMajorPrefix is not a valid major version")
- }
- return m
-}
-
-// CanonicalVersion returns the canonical form of the version string v.
-// It is the same as semver.Canonical(v) except that it preserves the special build suffix "+incompatible".
-func CanonicalVersion(v string) string {
- cv := semver.Canonical(v)
- if semver.Build(v) == "+incompatible" {
- cv += "+incompatible"
- }
- return cv
-}
-
-// Sort sorts the list by Path, breaking ties by comparing Versions.
-func Sort(list []Version) {
- sort.Slice(list, func(i, j int) bool {
- mi := list[i]
- mj := list[j]
- if mi.Path != mj.Path {
- return mi.Path < mj.Path
- }
- // To help go.sum formatting, allow version/file.
- // Compare semver prefix by semver rules,
- // file by string order.
- vi := mi.Version
- vj := mj.Version
- var fi, fj string
- if k := strings.Index(vi, "/"); k >= 0 {
- vi, fi = vi[:k], vi[k:]
- }
- if k := strings.Index(vj, "/"); k >= 0 {
- vj, fj = vj[:k], vj[k:]
- }
- if vi != vj {
- return semver.Compare(vi, vj) < 0
- }
- return fi < fj
- })
-}
-
-// Safe encodings
-//
-// Module paths appear as substrings of file system paths
-// (in the download cache) and of web server URLs in the proxy protocol.
-// In general we cannot rely on file systems to be case-sensitive,
-// nor can we rely on web servers, since they read from file systems.
-// That is, we cannot rely on the file system to keep rsc.io/QUOTE
-// and rsc.io/quote separate. Windows and macOS don't.
-// Instead, we must never require two different casings of a file path.
-// Because we want the download cache to match the proxy protocol,
-// and because we want the proxy protocol to be possible to serve
-// from a tree of static files (which might be stored on a case-insensitive
-// file system), the proxy protocol must never require two different casings
-// of a URL path either.
-//
-// One possibility would be to make the safe encoding be the lowercase
-// hexadecimal encoding of the actual path bytes. This would avoid ever
-// needing different casings of a file path, but it would be fairly illegible
-// to most programmers when those paths appeared in the file system
-// (including in file paths in compiler errors and stack traces)
-// in web server logs, and so on. Instead, we want a safe encoding that
-// leaves most paths unaltered.
-//
-// The safe encoding is this:
-// replace every uppercase letter with an exclamation mark
-// followed by the letter's lowercase equivalent.
-//
-// For example,
-// github.com/Azure/azure-sdk-for-go -> github.com/!azure/azure-sdk-for-go.
-// github.com/GoogleCloudPlatform/cloudsql-proxy -> github.com/!google!cloud!platform/cloudsql-proxy
-// github.com/Sirupsen/logrus -> github.com/!sirupsen/logrus.
-//
-// Import paths that avoid upper-case letters are left unchanged.
-// Note that because import paths are ASCII-only and avoid various
-// problematic punctuation (like : < and >), the safe encoding is also ASCII-only
-// and avoids the same problematic punctuation.
-//
-// Import paths have never allowed exclamation marks, so there is no
-// need to define how to encode a literal !.
-//
-// Although paths are disallowed from using Unicode (see pathOK above),
-// the eventual plan is to allow Unicode letters as well, to assume that
-// file systems and URLs are Unicode-safe (storing UTF-8), and apply
-// the !-for-uppercase convention. Note however that not all runes that
-// are different but case-fold equivalent are an upper/lower pair.
-// For example, U+004B ('K'), U+006B ('k'), and U+212A ('K' for Kelvin)
-// are considered to case-fold to each other. When we do add Unicode
-// letters, we must not assume that upper/lower are the only case-equivalent pairs.
-// Perhaps the Kelvin symbol would be disallowed entirely, for example.
-// Or perhaps it would encode as "!!k", or perhaps as "(212A)".
-//
-// Also, it would be nice to allow Unicode marks as well as letters,
-// but marks include combining marks, and then we must deal not
-// only with case folding but also normalization: both U+00E9 ('é')
-// and U+0065 U+0301 ('e' followed by combining acute accent)
-// look the same on the page and are treated by some file systems
-// as the same path. If we do allow Unicode marks in paths, there
-// must be some kind of normalization to allow only one canonical
-// encoding of any character used in an import path.
-
-// EncodePath returns the safe encoding of the given module path.
-// It fails if the module path is invalid.
-func EncodePath(path string) (encoding string, err error) {
- if err := CheckPath(path); err != nil {
- return "", err
- }
-
- return encodeString(path)
-}
-
-// EncodeVersion returns the safe encoding of the given module version.
-// Versions are allowed to be in non-semver form but must be valid file names
-// and not contain exclamation marks.
-func EncodeVersion(v string) (encoding string, err error) {
- if err := checkElem(v, true); err != nil || strings.Contains(v, "!") {
- return "", &InvalidVersionError{
- Version: v,
- Err: fmt.Errorf("disallowed version string"),
- }
- }
- return encodeString(v)
-}
-
-func encodeString(s string) (encoding string, err error) {
- haveUpper := false
- for _, r := range s {
- if r == '!' || r >= utf8.RuneSelf {
- // This should be disallowed by CheckPath, but diagnose anyway.
- // The correctness of the encoding loop below depends on it.
- return "", fmt.Errorf("internal error: inconsistency in EncodePath")
- }
- if 'A' <= r && r <= 'Z' {
- haveUpper = true
- }
- }
-
- if !haveUpper {
- return s, nil
- }
-
- var buf []byte
- for _, r := range s {
- if 'A' <= r && r <= 'Z' {
- buf = append(buf, '!', byte(r+'a'-'A'))
- } else {
- buf = append(buf, byte(r))
- }
- }
- return string(buf), nil
-}
-
-// DecodePath returns the module path of the given safe encoding.
-// It fails if the encoding is invalid or encodes an invalid path.
-func DecodePath(encoding string) (path string, err error) {
- path, ok := decodeString(encoding)
- if !ok {
- return "", fmt.Errorf("invalid module path encoding %q", encoding)
- }
- if err := CheckPath(path); err != nil {
- return "", fmt.Errorf("invalid module path encoding %q: %v", encoding, err)
- }
- return path, nil
-}
-
-// DecodeVersion returns the version string for the given safe encoding.
-// It fails if the encoding is invalid or encodes an invalid version.
-// Versions are allowed to be in non-semver form but must be valid file names
-// and not contain exclamation marks.
-func DecodeVersion(encoding string) (v string, err error) {
- v, ok := decodeString(encoding)
- if !ok {
- return "", fmt.Errorf("invalid version encoding %q", encoding)
- }
- if err := checkElem(v, true); err != nil {
- return "", fmt.Errorf("disallowed version string %q", v)
- }
- return v, nil
-}
-
-func decodeString(encoding string) (string, bool) {
- var buf []byte
-
- bang := false
- for _, r := range encoding {
- if r >= utf8.RuneSelf {
- return "", false
- }
- if bang {
- bang = false
- if r < 'a' || 'z' < r {
- return "", false
- }
- buf = append(buf, byte(r+'A'-'a'))
- continue
- }
- if r == '!' {
- bang = true
- continue
- }
- if 'A' <= r && r <= 'Z' {
- return "", false
- }
- buf = append(buf, byte(r))
- }
- if bang {
- return "", false
- }
- return string(buf), true
-}
diff --git a/libgo/go/cmd/go/internal/module/module_test.go b/libgo/go/cmd/go/internal/module/module_test.go
deleted file mode 100644
index b9f07bf57d5..00000000000
--- a/libgo/go/cmd/go/internal/module/module_test.go
+++ /dev/null
@@ -1,319 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package module
-
-import "testing"
-
-var checkTests = []struct {
- path string
- version string
- ok bool
-}{
- {"rsc.io/quote", "0.1.0", false},
- {"rsc io/quote", "v1.0.0", false},
-
- {"github.com/go-yaml/yaml", "v0.8.0", true},
- {"github.com/go-yaml/yaml", "v1.0.0", true},
- {"github.com/go-yaml/yaml", "v2.0.0", false},
- {"github.com/go-yaml/yaml", "v2.1.5", false},
- {"github.com/go-yaml/yaml", "v3.0.0", false},
-
- {"github.com/go-yaml/yaml/v2", "v1.0.0", false},
- {"github.com/go-yaml/yaml/v2", "v2.0.0", true},
- {"github.com/go-yaml/yaml/v2", "v2.1.5", true},
- {"github.com/go-yaml/yaml/v2", "v3.0.0", false},
-
- {"gopkg.in/yaml.v0", "v0.8.0", true},
- {"gopkg.in/yaml.v0", "v1.0.0", false},
- {"gopkg.in/yaml.v0", "v2.0.0", false},
- {"gopkg.in/yaml.v0", "v2.1.5", false},
- {"gopkg.in/yaml.v0", "v3.0.0", false},
-
- {"gopkg.in/yaml.v1", "v0.8.0", false},
- {"gopkg.in/yaml.v1", "v1.0.0", true},
- {"gopkg.in/yaml.v1", "v2.0.0", false},
- {"gopkg.in/yaml.v1", "v2.1.5", false},
- {"gopkg.in/yaml.v1", "v3.0.0", false},
-
- // For gopkg.in, .v1 means v1 only (not v0).
- // But early versions of vgo still generated v0 pseudo-versions for it.
- // Even though now we'd generate those as v1 pseudo-versions,
- // we accept the old pseudo-versions to avoid breaking existing go.mod files.
- // For example gopkg.in/yaml.v2@v2.2.1's go.mod requires check.v1 at a v0 pseudo-version.
- {"gopkg.in/check.v1", "v0.0.0", false},
- {"gopkg.in/check.v1", "v0.0.0-20160102150405-abcdef123456", true},
-
- {"gopkg.in/yaml.v2", "v1.0.0", false},
- {"gopkg.in/yaml.v2", "v2.0.0", true},
- {"gopkg.in/yaml.v2", "v2.1.5", true},
- {"gopkg.in/yaml.v2", "v3.0.0", false},
-
- {"rsc.io/quote", "v17.0.0", false},
- {"rsc.io/quote", "v17.0.0+incompatible", true},
-}
-
-func TestCheck(t *testing.T) {
- for _, tt := range checkTests {
- err := Check(tt.path, tt.version)
- if tt.ok && err != nil {
- t.Errorf("Check(%q, %q) = %v, wanted nil error", tt.path, tt.version, err)
- } else if !tt.ok && err == nil {
- t.Errorf("Check(%q, %q) succeeded, wanted error", tt.path, tt.version)
- }
- }
-}
-
-var checkPathTests = []struct {
- path string
- ok bool
- importOK bool
- fileOK bool
-}{
- {"x.y/z", true, true, true},
- {"x.y", true, true, true},
-
- {"", false, false, false},
- {"x.y/\xFFz", false, false, false},
- {"/x.y/z", false, false, false},
- {"x./z", false, false, false},
- {".x/z", false, false, true},
- {"-x/z", false, false, false},
- {"x..y/z", false, false, false},
- {"x.y/z/../../w", false, false, false},
- {"x.y//z", false, false, false},
- {"x.y/z//w", false, false, false},
- {"x.y/z/", false, false, false},
-
- {"x.y/z/v0", false, true, true},
- {"x.y/z/v1", false, true, true},
- {"x.y/z/v2", true, true, true},
- {"x.y/z/v2.0", false, true, true},
- {"X.y/z", false, true, true},
-
- {"!x.y/z", false, false, true},
- {"_x.y/z", false, true, true},
- {"x.y!/z", false, false, true},
- {"x.y\"/z", false, false, false},
- {"x.y#/z", false, false, true},
- {"x.y$/z", false, false, true},
- {"x.y%/z", false, false, true},
- {"x.y&/z", false, false, true},
- {"x.y'/z", false, false, false},
- {"x.y(/z", false, false, true},
- {"x.y)/z", false, false, true},
- {"x.y*/z", false, false, false},
- {"x.y+/z", false, true, true},
- {"x.y,/z", false, false, true},
- {"x.y-/z", true, true, true},
- {"x.y./zt", false, false, false},
- {"x.y:/z", false, false, false},
- {"x.y;/z", false, false, false},
- {"x.y</z", false, false, false},
- {"x.y=/z", false, false, true},
- {"x.y>/z", false, false, false},
- {"x.y?/z", false, false, false},
- {"x.y@/z", false, false, true},
- {"x.y[/z", false, false, true},
- {"x.y\\/z", false, false, false},
- {"x.y]/z", false, false, true},
- {"x.y^/z", false, false, true},
- {"x.y_/z", false, true, true},
- {"x.y`/z", false, false, false},
- {"x.y{/z", false, false, true},
- {"x.y}/z", false, false, true},
- {"x.y~/z", false, true, true},
- {"x.y/z!", false, false, true},
- {"x.y/z\"", false, false, false},
- {"x.y/z#", false, false, true},
- {"x.y/z$", false, false, true},
- {"x.y/z%", false, false, true},
- {"x.y/z&", false, false, true},
- {"x.y/z'", false, false, false},
- {"x.y/z(", false, false, true},
- {"x.y/z)", false, false, true},
- {"x.y/z*", false, false, false},
- {"x.y/z+", true, true, true},
- {"x.y/z,", false, false, true},
- {"x.y/z-", true, true, true},
- {"x.y/z.t", true, true, true},
- {"x.y/z/t", true, true, true},
- {"x.y/z:", false, false, false},
- {"x.y/z;", false, false, false},
- {"x.y/z<", false, false, false},
- {"x.y/z=", false, false, true},
- {"x.y/z>", false, false, false},
- {"x.y/z?", false, false, false},
- {"x.y/z@", false, false, true},
- {"x.y/z[", false, false, true},
- {"x.y/z\\", false, false, false},
- {"x.y/z]", false, false, true},
- {"x.y/z^", false, false, true},
- {"x.y/z_", true, true, true},
- {"x.y/z`", false, false, false},
- {"x.y/z{", false, false, true},
- {"x.y/z}", false, false, true},
- {"x.y/z~", true, true, true},
- {"x.y/x.foo", true, true, true},
- {"x.y/aux.foo", false, false, false},
- {"x.y/prn", false, false, false},
- {"x.y/prn2", true, true, true},
- {"x.y/com", true, true, true},
- {"x.y/com1", false, false, false},
- {"x.y/com1.txt", false, false, false},
- {"x.y/calm1", true, true, true},
- {"github.com/!123/logrus", false, false, true},
-
- // TODO: CL 41822 allowed Unicode letters in old "go get"
- // without due consideration of the implications, and only on github.com (!).
- // For now, we disallow non-ASCII characters in module mode,
- // in both module paths and general import paths,
- // until we can get the implications right.
- // When we do, we'll enable them everywhere, not just for GitHub.
- {"github.com/user/unicode/испытание", false, false, true},
-
- {"../x", false, false, false},
- {"./y", false, false, false},
- {"x:y", false, false, false},
- {`\temp\foo`, false, false, false},
- {".gitignore", false, false, true},
- {".github/ISSUE_TEMPLATE", false, false, true},
- {"x☺y", false, false, false},
-}
-
-func TestCheckPath(t *testing.T) {
- for _, tt := range checkPathTests {
- err := CheckPath(tt.path)
- if tt.ok && err != nil {
- t.Errorf("CheckPath(%q) = %v, wanted nil error", tt.path, err)
- } else if !tt.ok && err == nil {
- t.Errorf("CheckPath(%q) succeeded, wanted error", tt.path)
- }
-
- err = CheckImportPath(tt.path)
- if tt.importOK && err != nil {
- t.Errorf("CheckImportPath(%q) = %v, wanted nil error", tt.path, err)
- } else if !tt.importOK && err == nil {
- t.Errorf("CheckImportPath(%q) succeeded, wanted error", tt.path)
- }
-
- err = CheckFilePath(tt.path)
- if tt.fileOK && err != nil {
- t.Errorf("CheckFilePath(%q) = %v, wanted nil error", tt.path, err)
- } else if !tt.fileOK && err == nil {
- t.Errorf("CheckFilePath(%q) succeeded, wanted error", tt.path)
- }
- }
-}
-
-var splitPathVersionTests = []struct {
- pathPrefix string
- version string
-}{
- {"x.y/z", ""},
- {"x.y/z", "/v2"},
- {"x.y/z", "/v3"},
- {"x.y/v", ""},
- {"gopkg.in/yaml", ".v0"},
- {"gopkg.in/yaml", ".v1"},
- {"gopkg.in/yaml", ".v2"},
- {"gopkg.in/yaml", ".v3"},
-}
-
-func TestSplitPathVersion(t *testing.T) {
- for _, tt := range splitPathVersionTests {
- pathPrefix, version, ok := SplitPathVersion(tt.pathPrefix + tt.version)
- if pathPrefix != tt.pathPrefix || version != tt.version || !ok {
- t.Errorf("SplitPathVersion(%q) = %q, %q, %v, want %q, %q, true", tt.pathPrefix+tt.version, pathPrefix, version, ok, tt.pathPrefix, tt.version)
- }
- }
-
- for _, tt := range checkPathTests {
- pathPrefix, version, ok := SplitPathVersion(tt.path)
- if pathPrefix+version != tt.path {
- t.Errorf("SplitPathVersion(%q) = %q, %q, %v, doesn't add to input", tt.path, pathPrefix, version, ok)
- }
- }
-}
-
-var encodeTests = []struct {
- path string
- enc string // empty means same as path
-}{
- {path: "ascii.com/abcdefghijklmnopqrstuvwxyz.-+/~_0123456789"},
- {path: "github.com/GoogleCloudPlatform/omega", enc: "github.com/!google!cloud!platform/omega"},
-}
-
-func TestEncodePath(t *testing.T) {
- // Check invalid paths.
- for _, tt := range checkPathTests {
- if !tt.ok {
- _, err := EncodePath(tt.path)
- if err == nil {
- t.Errorf("EncodePath(%q): succeeded, want error (invalid path)", tt.path)
- }
- }
- }
-
- // Check encodings.
- for _, tt := range encodeTests {
- enc, err := EncodePath(tt.path)
- if err != nil {
- t.Errorf("EncodePath(%q): unexpected error: %v", tt.path, err)
- continue
- }
- want := tt.enc
- if want == "" {
- want = tt.path
- }
- if enc != want {
- t.Errorf("EncodePath(%q) = %q, want %q", tt.path, enc, want)
- }
- }
-}
-
-var badDecode = []string{
- "github.com/GoogleCloudPlatform/omega",
- "github.com/!google!cloud!platform!/omega",
- "github.com/!0google!cloud!platform/omega",
- "github.com/!_google!cloud!platform/omega",
- "github.com/!!google!cloud!platform/omega",
- "",
-}
-
-func TestDecodePath(t *testing.T) {
- // Check invalid decodings.
- for _, bad := range badDecode {
- _, err := DecodePath(bad)
- if err == nil {
- t.Errorf("DecodePath(%q): succeeded, want error (invalid decoding)", bad)
- }
- }
-
- // Check invalid paths (or maybe decodings).
- for _, tt := range checkPathTests {
- if !tt.ok {
- path, err := DecodePath(tt.path)
- if err == nil {
- t.Errorf("DecodePath(%q) = %q, want error (invalid path)", tt.path, path)
- }
- }
- }
-
- // Check encodings.
- for _, tt := range encodeTests {
- enc := tt.enc
- if enc == "" {
- enc = tt.path
- }
- path, err := DecodePath(enc)
- if err != nil {
- t.Errorf("DecodePath(%q): unexpected error: %v", enc, err)
- continue
- }
- if path != tt.path {
- t.Errorf("DecodePath(%q) = %q, want %q", enc, path, tt.path)
- }
- }
-}
diff --git a/libgo/go/cmd/go/internal/mvs/mvs.go b/libgo/go/cmd/go/internal/mvs/mvs.go
index 4e7a828c24f..dd3b3ccb865 100644
--- a/libgo/go/cmd/go/internal/mvs/mvs.go
+++ b/libgo/go/cmd/go/internal/mvs/mvs.go
@@ -13,8 +13,9 @@ import (
"sync"
"sync/atomic"
- "cmd/go/internal/module"
"cmd/go/internal/par"
+
+ "golang.org/x/mod/module"
)
// A Reqs is the requirement graph on which Minimal Version Selection (MVS) operates.
@@ -250,10 +251,15 @@ func buildList(target module.Version, reqs Reqs, upgrade func(module.Version) (m
return list, nil
}
-// Req returns the minimal requirement list for the target module
-// that results in the given build list, with the constraint that all
-// module paths listed in base must appear in the returned list.
-func Req(target module.Version, list []module.Version, base []string, reqs Reqs) ([]module.Version, error) {
+// Req returns the minimal requirement list for the target module,
+// with the constraint that all module paths listed in base must
+// appear in the returned list.
+func Req(target module.Version, base []string, reqs Reqs) ([]module.Version, error) {
+ list, err := BuildList(target, reqs)
+ if err != nil {
+ return nil, err
+ }
+
// Note: Not running in parallel because we assume
// that list came from a previous operation that paged
// in all the requirements, so there's no I/O to overlap now.
diff --git a/libgo/go/cmd/go/internal/mvs/mvs_test.go b/libgo/go/cmd/go/internal/mvs/mvs_test.go
index 72d3ea95b79..9a30a8c3ac0 100644
--- a/libgo/go/cmd/go/internal/mvs/mvs_test.go
+++ b/libgo/go/cmd/go/internal/mvs/mvs_test.go
@@ -10,7 +10,7 @@ import (
"strings"
"testing"
- "cmd/go/internal/module"
+ "golang.org/x/mod/module"
)
var tests = `
@@ -280,6 +280,20 @@ D2:
build A: A B1 C1 D1
upgrade* A: A B2 C2 D2
+# Cycles with multiple possible solutions.
+# (golang.org/issue/34086)
+name: cycle3
+M: A1 C2
+A1: B1
+B1: C1
+B2: C2
+C1:
+C2: B2
+build M: M A1 B2 C2
+req M: A1 B2
+req M A: A1 B2
+req M C: A1 C2
+
# Requirement minimization.
name: req1
@@ -390,7 +404,15 @@ func Test(t *testing.T) {
fns = append(fns, func(t *testing.T) {
list, err := Upgrade(m(kf[1]), reqs, ms(kf[2:])...)
if err == nil {
- list, err = Req(m(kf[1]), list, nil, reqs)
+ // Copy the reqs map, but substitute the upgraded requirements in
+ // place of the target's original requirements.
+ upReqs := make(reqsMap, len(reqs))
+ for m, r := range reqs {
+ upReqs[m] = r
+ }
+ upReqs[m(kf[1])] = list
+
+ list, err = Req(m(kf[1]), nil, upReqs)
}
checkList(t, key, list, err, val)
})
@@ -418,11 +440,7 @@ func Test(t *testing.T) {
t.Fatalf("req takes at least one argument: %q", line)
}
fns = append(fns, func(t *testing.T) {
- list, err := BuildList(m(kf[1]), reqs)
- if err != nil {
- t.Fatal(err)
- }
- list, err = Req(m(kf[1]), list, kf[2:], reqs)
+ list, err := Req(m(kf[1]), kf[2:], reqs)
checkList(t, key, list, err, val)
})
continue
diff --git a/libgo/go/cmd/go/internal/note/example_test.go b/libgo/go/cmd/go/internal/note/example_test.go
deleted file mode 100644
index 53554b4c23f..00000000000
--- a/libgo/go/cmd/go/internal/note/example_test.go
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package note_test
-
-import (
- "fmt"
- "io"
- "os"
-
- "cmd/go/internal/note"
-)
-
-func ExampleSign() {
- skey := "PRIVATE+KEY+PeterNeumann+c74f20a3+AYEKFALVFGyNhPJEMzD1QIDr+Y7hfZx09iUvxdXHKDFz"
- text := "If you think cryptography is the answer to your problem,\n" +
- "then you don't know what your problem is.\n"
-
- signer, err := note.NewSigner(skey)
- if err != nil {
- fmt.Println(err)
- return
- }
-
- msg, err := note.Sign(&note.Note{Text: text}, signer)
- if err != nil {
- fmt.Println(err)
- return
- }
- os.Stdout.Write(msg)
-
- // Output:
- // If you think cryptography is the answer to your problem,
- // then you don't know what your problem is.
- //
- // — PeterNeumann x08go/ZJkuBS9UG/SffcvIAQxVBtiFupLLr8pAcElZInNIuGUgYN1FFYC2pZSNXgKvqfqdngotpRZb6KE6RyyBwJnAM=
-}
-
-func ExampleOpen() {
- vkey := "PeterNeumann+c74f20a3+ARpc2QcUPDhMQegwxbzhKqiBfsVkmqq/LDE4izWy10TW"
- msg := []byte("If you think cryptography is the answer to your problem,\n" +
- "then you don't know what your problem is.\n" +
- "\n" +
- "— PeterNeumann x08go/ZJkuBS9UG/SffcvIAQxVBtiFupLLr8pAcElZInNIuGUgYN1FFYC2pZSNXgKvqfqdngotpRZb6KE6RyyBwJnAM=\n")
-
- verifier, err := note.NewVerifier(vkey)
- if err != nil {
- fmt.Println(err)
- return
- }
- verifiers := note.VerifierList(verifier)
-
- n, err := note.Open(msg, verifiers)
- if err != nil {
- fmt.Println(err)
- return
- }
- fmt.Printf("%s (%08x):\n%s", n.Sigs[0].Name, n.Sigs[0].Hash, n.Text)
-
- // Output:
- // PeterNeumann (c74f20a3):
- // If you think cryptography is the answer to your problem,
- // then you don't know what your problem is.
-}
-
-var rand = struct {
- Reader io.Reader
-}{
- zeroReader{},
-}
-
-type zeroReader struct{}
-
-func (zeroReader) Read(buf []byte) (int, error) {
- for i := range buf {
- buf[i] = 0
- }
- return len(buf), nil
-}
-
-func ExampleSign_add_signatures() {
- vkey := "PeterNeumann+c74f20a3+ARpc2QcUPDhMQegwxbzhKqiBfsVkmqq/LDE4izWy10TW"
- msg := []byte("If you think cryptography is the answer to your problem,\n" +
- "then you don't know what your problem is.\n" +
- "\n" +
- "— PeterNeumann x08go/ZJkuBS9UG/SffcvIAQxVBtiFupLLr8pAcElZInNIuGUgYN1FFYC2pZSNXgKvqfqdngotpRZb6KE6RyyBwJnAM=\n")
-
- verifier, err := note.NewVerifier(vkey)
- if err != nil {
- fmt.Println(err)
- return
- }
- verifiers := note.VerifierList(verifier)
-
- n, err := note.Open([]byte(msg), verifiers)
- if err != nil {
- fmt.Println(err)
- return
- }
-
- skey, vkey, err := note.GenerateKey(rand.Reader, "EnochRoot")
- if err != nil {
- fmt.Println(err)
- return
- }
- _ = vkey // give to verifiers
-
- me, err := note.NewSigner(skey)
- if err != nil {
- fmt.Println(err)
- return
- }
-
- msg, err = note.Sign(n, me)
- if err != nil {
- fmt.Println(err)
- return
- }
- os.Stdout.Write(msg)
-
- // Output:
- // If you think cryptography is the answer to your problem,
- // then you don't know what your problem is.
- //
- // — PeterNeumann x08go/ZJkuBS9UG/SffcvIAQxVBtiFupLLr8pAcElZInNIuGUgYN1FFYC2pZSNXgKvqfqdngotpRZb6KE6RyyBwJnAM=
- // — EnochRoot rwz+eBzmZa0SO3NbfRGzPCpDckykFXSdeX+MNtCOXm2/5n2tiOHp+vAF1aGrQ5ovTG01oOTGwnWLox33WWd1RvMc+QQ=
-}
diff --git a/libgo/go/cmd/go/internal/note/note.go b/libgo/go/cmd/go/internal/note/note.go
deleted file mode 100644
index f770da24b37..00000000000
--- a/libgo/go/cmd/go/internal/note/note.go
+++ /dev/null
@@ -1,683 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package note defines the notes signed by the Go module database server.
-//
-// This package is part of a DRAFT of what the Go module database server will look like.
-// Do not assume the details here are final!
-//
-// A note is text signed by one or more server keys.
-// The text should be ignored unless the note is signed by
-// a trusted server key and the signature has been verified
-// using the server's public key.
-//
-// A server's public key is identified by a name, typically the "host[/path]"
-// giving the base URL of the server's transparency log.
-// The syntactic restrictions on a name are that it be non-empty,
-// well-formed UTF-8 containing neither Unicode spaces nor plus (U+002B).
-//
-// A Go module database server signs texts using public key cryptography.
-// A given server may have multiple public keys, each
-// identified by the first 32 bits of the SHA-256 hash of
-// the concatenation of the server name, a newline, and
-// the encoded public key.
-//
-// Verifying Notes
-//
-// A Verifier allows verification of signatures by one server public key.
-// It can report the name of the server and the uint32 hash of the key,
-// and it can verify a purported signature by that key.
-//
-// The standard implementation of a Verifier is constructed
-// by NewVerifier starting from a verifier key, which is a
-// plain text string of the form "<name>+<hash>+<keydata>".
-//
-// A Verifiers allows looking up a Verifier by the combination
-// of server name and key hash.
-//
-// The standard implementation of a Verifiers is constructed
-// by VerifierList from a list of known verifiers.
-//
-// A Note represents a text with one or more signatures.
-// An implementation can reject a note with too many signatures
-// (for example, more than 100 signatures).
-//
-// A Signature represents a signature on a note, verified or not.
-//
-// The Open function takes as input a signed message
-// and a set of known verifiers. It decodes and verifies
-// the message signatures and returns a Note structure
-// containing the message text and (verified or unverified) signatures.
-//
-// Signing Notes
-//
-// A Signer allows signing a text with a given key.
-// It can report the name of the server and the hash of the key
-// and can sign a raw text using that key.
-//
-// The standard implementation of a Signer is constructed
-// by NewSigner starting from an encoded signer key, which is a
-// plain text string of the form "PRIVATE+KEY+<name>+<hash>+<keydata>".
-// Anyone with an encoded signer key can sign messages using that key,
-// so it must be kept secret. The encoding begins with the literal text
-// "PRIVATE+KEY" to avoid confusion with the public server key.
-//
-// The Sign function takes as input a Note and a list of Signers
-// and returns an encoded, signed message.
-//
-// Signed Note Format
-//
-// A signed note consists of a text ending in newline (U+000A),
-// followed by a blank line (only a newline),
-// followed by one or more signature lines of this form:
-// em dash (U+2014), space (U+0020),
-// server name, space, base64-encoded signature, newline.
-//
-// Signed notes must be valid UTF-8 and must not contain any
-// ASCII control characters (those below U+0020) other than newline.
-//
-// A signature is a base64 encoding of 4+n bytes.
-//
-// The first four bytes in the signature are the uint32 key hash
-// stored in big-endian order, which is to say they are the first
-// four bytes of the truncated SHA-256 used to derive the key hash
-// in the first place.
-//
-// The remaining n bytes are the result of using the specified key
-// to sign the note text (including the final newline but not the
-// separating blank line).
-//
-// Generating Keys
-//
-// There is only one key type, Ed25519 with algorithm identifier 1.
-// New key types may be introduced in the future as needed,
-// although doing so will require deploying the new algorithms to all clients
-// before starting to depend on them for signatures.
-//
-// The GenerateKey function generates and returns a new signer
-// and corresponding verifier.
-//
-// Example
-//
-// Here is a well-formed signed note:
-//
-// If you think cryptography is the answer to your problem,
-// then you don't know what your problem is.
-//
-// — PeterNeumann x08go/ZJkuBS9UG/SffcvIAQxVBtiFupLLr8pAcElZInNIuGUgYN1FFYC2pZSNXgKvqfqdngotpRZb6KE6RyyBwJnAM=
-//
-// It can be constructed and displayed using:
-//
-// skey := "PRIVATE+KEY+PeterNeumann+c74f20a3+AYEKFALVFGyNhPJEMzD1QIDr+Y7hfZx09iUvxdXHKDFz"
-// text := "If you think cryptography is the answer to your problem,\n" +
-// "then you don't know what your problem is.\n"
-//
-// signer, err := note.NewSigner(skey)
-// if err != nil {
-// log.Fatal(err)
-// }
-//
-// msg, err := note.Sign(&note.Note{Text: text}, signer)
-// if err != nil {
-// log.Fatal(err)
-// }
-// os.Stdout.Write(msg)
-//
-// The note's text is two lines, including the final newline,
-// and the text is purportedly signed by a server named
-// "PeterNeumann". (Although server names are canonically
-// base URLs, the only syntactic requirement is that they
-// not contain spaces or newlines).
-//
-// If Open is given access to a Verifiers including the
-// Verifier for this key, then it will succeed at verifiying
-// the encoded message and returning the parsed Note:
-//
-// vkey := "PeterNeumann+c74f20a3+ARpc2QcUPDhMQegwxbzhKqiBfsVkmqq/LDE4izWy10TW"
-// msg := []byte("If you think cryptography is the answer to your problem,\n" +
-// "then you don't know what your problem is.\n" +
-// "\n" +
-// "— PeterNeumann x08go/ZJkuBS9UG/SffcvIAQxVBtiFupLLr8pAcElZInNIuGUgYN1FFYC2pZSNXgKvqfqdngotpRZb6KE6RyyBwJnAM=\n")
-//
-// verifier, err := note.NewVerifier(vkey)
-// if err != nil {
-// log.Fatal(err)
-// }
-// verifiers := note.VerifierList(verifier)
-//
-// n, err := note.Open([]byte(msg), verifiers)
-// if err != nil {
-// log.Fatal(err)
-// }
-// fmt.Printf("%s (%08x):\n%s", n.Sigs[0].Name, n.Sigs[0].Hash, n.Text)
-//
-// You can add your own signature to this message by re-signing the note:
-//
-// skey, vkey, err := note.GenerateKey(rand.Reader, "EnochRoot")
-// if err != nil {
-// log.Fatal(err)
-// }
-// _ = vkey // give to verifiers
-//
-// me, err := note.NewSigner(skey)
-// if err != nil {
-// log.Fatal(err)
-// }
-//
-// msg, err := note.Sign(n, me)
-// if err != nil {
-// log.Fatal(err)
-// }
-// os.Stdout.Write(msg)
-//
-// This will print a doubly-signed message, like:
-//
-// If you think cryptography is the answer to your problem,
-// then you don't know what your problem is.
-//
-// — PeterNeumann x08go/ZJkuBS9UG/SffcvIAQxVBtiFupLLr8pAcElZInNIuGUgYN1FFYC2pZSNXgKvqfqdngotpRZb6KE6RyyBwJnAM=
-// — EnochRoot rwz+eBzmZa0SO3NbfRGzPCpDckykFXSdeX+MNtCOXm2/5n2tiOHp+vAF1aGrQ5ovTG01oOTGwnWLox33WWd1RvMc+QQ=
-//
-package note
-
-import (
- "bytes"
- "crypto/ed25519"
- "crypto/sha256"
- "encoding/base64"
- "encoding/binary"
- "errors"
- "fmt"
- "io"
- "strconv"
- "strings"
- "unicode"
- "unicode/utf8"
-)
-
-// A Verifier verifies messages signed with a specific key.
-type Verifier interface {
- // Name returns the server name associated with the key.
- Name() string
-
- // KeyHash returns the key hash.
- KeyHash() uint32
-
- // Verify reports whether sig is a valid signature of msg.
- Verify(msg, sig []byte) bool
-}
-
-// A Signer signs messages using a specific key.
-type Signer interface {
- // Name returns the server name associated with the key.
- Name() string
-
- // KeyHash returns the key hash.
- KeyHash() uint32
-
- // Sign returns a signature for the given message.
- Sign(msg []byte) ([]byte, error)
-}
-
-// keyHash computes the key hash for the given server name and encoded public key.
-func keyHash(name string, key []byte) uint32 {
- h := sha256.New()
- h.Write([]byte(name))
- h.Write([]byte("\n"))
- h.Write(key)
- sum := h.Sum(nil)
- return binary.BigEndian.Uint32(sum)
-}
-
-var (
- errVerifierID = errors.New("malformed verifier id")
- errVerifierAlg = errors.New("unknown verifier algorithm")
- errVerifierHash = errors.New("invalid verifier hash")
-)
-
-const (
- algEd25519 = 1
-)
-
-// isValidName reports whether name is valid.
-// It must be non-empty and not have any Unicode spaces or pluses.
-func isValidName(name string) bool {
- return name != "" && utf8.ValidString(name) && strings.IndexFunc(name, unicode.IsSpace) < 0 && !strings.Contains(name, "+")
-}
-
-// NewVerifier construct a new Verifier from an encoded verifier key.
-func NewVerifier(vkey string) (Verifier, error) {
- name, vkey := chop(vkey, "+")
- hash16, key64 := chop(vkey, "+")
- hash, err1 := strconv.ParseUint(hash16, 16, 32)
- key, err2 := base64.StdEncoding.DecodeString(key64)
- if len(hash16) != 8 || err1 != nil || err2 != nil || !isValidName(name) || len(key) == 0 {
- return nil, errVerifierID
- }
- if uint32(hash) != keyHash(name, key) {
- return nil, errVerifierHash
- }
-
- v := &verifier{
- name: name,
- hash: uint32(hash),
- }
-
- alg, key := key[0], key[1:]
- switch alg {
- default:
- return nil, errVerifierAlg
-
- case algEd25519:
- if len(key) != 32 {
- return nil, errVerifierID
- }
- v.verify = func(msg, sig []byte) bool {
- return ed25519.Verify(key, msg, sig)
- }
- }
-
- return v, nil
-}
-
-// chop chops s at the first instance of sep, if any,
-// and returns the text before and after sep.
-// If sep is not present, chop returns before is s and after is empty.
-func chop(s, sep string) (before, after string) {
- i := strings.Index(s, sep)
- if i < 0 {
- return s, ""
- }
- return s[:i], s[i+len(sep):]
-}
-
-// verifier is a trivial Verifier implementation.
-type verifier struct {
- name string
- hash uint32
- verify func([]byte, []byte) bool
-}
-
-func (v *verifier) Name() string { return v.name }
-func (v *verifier) KeyHash() uint32 { return v.hash }
-func (v *verifier) Verify(msg, sig []byte) bool { return v.verify(msg, sig) }
-
-// NewSigner constructs a new Signer from an encoded signer key.
-func NewSigner(skey string) (Signer, error) {
- priv1, skey := chop(skey, "+")
- priv2, skey := chop(skey, "+")
- name, skey := chop(skey, "+")
- hash16, key64 := chop(skey, "+")
- hash, err1 := strconv.ParseUint(hash16, 16, 32)
- key, err2 := base64.StdEncoding.DecodeString(key64)
- if priv1 != "PRIVATE" || priv2 != "KEY" || len(hash16) != 8 || err1 != nil || err2 != nil || !isValidName(name) || len(key) == 0 {
- return nil, errSignerID
- }
-
- // Note: hash is the hash of the public key and we have the private key.
- // Must verify hash after deriving public key.
-
- s := &signer{
- name: name,
- hash: uint32(hash),
- }
-
- var pubkey []byte
-
- alg, key := key[0], key[1:]
- switch alg {
- default:
- return nil, errSignerAlg
-
- case algEd25519:
- if len(key) != 32 {
- return nil, errSignerID
- }
- key = ed25519.NewKeyFromSeed(key)
- pubkey = append([]byte{algEd25519}, key[32:]...)
- s.sign = func(msg []byte) ([]byte, error) {
- return ed25519.Sign(key, msg), nil
- }
- }
-
- if uint32(hash) != keyHash(name, pubkey) {
- return nil, errSignerHash
- }
-
- return s, nil
-}
-
-var (
- errSignerID = errors.New("malformed verifier id")
- errSignerAlg = errors.New("unknown verifier algorithm")
- errSignerHash = errors.New("invalid verifier hash")
-)
-
-// signer is a trivial Signer implementation.
-type signer struct {
- name string
- hash uint32
- sign func([]byte) ([]byte, error)
-}
-
-func (s *signer) Name() string { return s.name }
-func (s *signer) KeyHash() uint32 { return s.hash }
-func (s *signer) Sign(msg []byte) ([]byte, error) { return s.sign(msg) }
-
-// GenerateKey generates a signer and verifier key pair for a named server.
-// The signer key skey is private and must be kept secret.
-func GenerateKey(rand io.Reader, name string) (skey, vkey string, err error) {
- pub, priv, err := ed25519.GenerateKey(rand)
- if err != nil {
- return "", "", err
- }
- pubkey := append([]byte{algEd25519}, pub...)
- privkey := append([]byte{algEd25519}, priv.Seed()...)
- h := keyHash(name, pubkey)
-
- skey = fmt.Sprintf("PRIVATE+KEY+%s+%08x+%s", name, h, base64.StdEncoding.EncodeToString(privkey))
- vkey = fmt.Sprintf("%s+%08x+%s", name, h, base64.StdEncoding.EncodeToString(pubkey))
- return skey, vkey, nil
-}
-
-// NewEd25519VerifierKey returns an encoded verifier key using the given name
-// and Ed25519 public key.
-func NewEd25519VerifierKey(name string, key ed25519.PublicKey) (string, error) {
- if len(key) != ed25519.PublicKeySize {
- return "", fmt.Errorf("invalid public key size %d, expected %d", len(key), ed25519.PublicKeySize)
- }
-
- pubkey := append([]byte{algEd25519}, key...)
- hash := keyHash(name, pubkey)
-
- b64Key := base64.StdEncoding.EncodeToString(pubkey)
- return fmt.Sprintf("%s+%08x+%s", name, hash, b64Key), nil
-}
-
-// A Verifiers is a collection of known verifier keys.
-type Verifiers interface {
- // Verifier returns the Verifier associated with the key
- // identified by the name and hash.
- // If the name, hash pair is unknown, Verifier should return
- // an UnknownVerifierError.
- Verifier(name string, hash uint32) (Verifier, error)
-}
-
-// An UnknownVerifierError indicates that the given key is not known.
-// The Open function records signatures without associated verifiers as
-// unverified signatures.
-type UnknownVerifierError struct {
- Name string
- KeyHash uint32
-}
-
-func (e *UnknownVerifierError) Error() string {
- return fmt.Sprintf("unknown key %s+%08x", e.Name, e.KeyHash)
-}
-
-// An ambiguousVerifierError indicates that the given name and hash
-// match multiple keys passed to VerifierList.
-// (If this happens, some malicious actor has taken control of the
-// verifier list, at which point we may as well give up entirely,
-// but we diagnose the problem instead.)
-type ambiguousVerifierError struct {
- name string
- hash uint32
-}
-
-func (e *ambiguousVerifierError) Error() string {
- return fmt.Sprintf("ambiguous key %s+%08x", e.name, e.hash)
-}
-
-// VerifierList returns a Verifiers implementation that uses the given list of verifiers.
-func VerifierList(list ...Verifier) Verifiers {
- m := make(verifierMap)
- for _, v := range list {
- k := nameHash{v.Name(), v.KeyHash()}
- m[k] = append(m[k], v)
- }
- return m
-}
-
-type nameHash struct {
- name string
- hash uint32
-}
-
-type verifierMap map[nameHash][]Verifier
-
-func (m verifierMap) Verifier(name string, hash uint32) (Verifier, error) {
- v, ok := m[nameHash{name, hash}]
- if !ok {
- return nil, &UnknownVerifierError{name, hash}
- }
- if len(v) > 1 {
- return nil, &ambiguousVerifierError{name, hash}
- }
- return v[0], nil
-}
-
-// A Note is a text and signatures.
-type Note struct {
- Text string // text of note
- Sigs []Signature // verified signatures
- UnverifiedSigs []Signature // unverified signatures
-}
-
-// A Signature is a single signature found in a note.
-type Signature struct {
- // Name and Hash give the name and key hash
- // for the key that generated the signature.
- Name string
- Hash uint32
-
- // Base64 records the base64-encoded signature bytes.
- Base64 string
-}
-
-// An UnverifiedNoteError indicates that the note
-// successfully parsed but had no verifiable signatures.
-type UnverifiedNoteError struct {
- Note *Note
-}
-
-func (e *UnverifiedNoteError) Error() string {
- return "note has no verifiable signatures"
-}
-
-// An InvalidSignatureError indicates that the given key was known
-// and the associated Verifier rejected the signature.
-type InvalidSignatureError struct {
- Name string
- Hash uint32
-}
-
-func (e *InvalidSignatureError) Error() string {
- return fmt.Sprintf("invalid signature for key %s+%08x", e.Name, e.Hash)
-}
-
-var (
- errMalformedNote = errors.New("malformed note")
- errInvalidSigner = errors.New("invalid signer")
-
- sigSplit = []byte("\n\n")
- sigPrefix = []byte("— ")
-)
-
-// Open opens and parses the message msg, checking signatures from the known verifiers.
-//
-// For each signature in the message, Open calls known.Verifier to find a verifier.
-// If known.Verifier returns a verifier and the verifier accepts the signature,
-// Open records the signature in the returned note's Sigs field.
-// If known.Verifier returns a verifier but the verifier rejects the signature,
-// Open returns an InvalidSignatureError.
-// If known.Verifier returns an UnknownVerifierError,
-// Open records the signature in the returned note's UnverifiedSigs field.
-// If known.Verifier returns any other error, Open returns that error.
-//
-// If no known verifier has signed an otherwise valid note,
-// Open returns an UnverifiedNoteError.
-// In this case, the unverified note can be fetched from inside the error.
-func Open(msg []byte, known Verifiers) (*Note, error) {
- if known == nil {
- // Treat nil Verifiers as empty list, to produce useful error instead of crash.
- known = VerifierList()
- }
-
- // Must have valid UTF-8 with no non-newline ASCII control characters.
- for i := 0; i < len(msg); {
- r, size := utf8.DecodeRune(msg[i:])
- if r < 0x20 && r != '\n' || r == utf8.RuneError && size == 1 {
- return nil, errMalformedNote
- }
- i += size
- }
-
- // Must end with signature block preceded by blank line.
- split := bytes.LastIndex(msg, sigSplit)
- if split < 0 {
- return nil, errMalformedNote
- }
- text, sigs := msg[:split+1], msg[split+2:]
- if len(sigs) == 0 || sigs[len(sigs)-1] != '\n' {
- return nil, errMalformedNote
- }
-
- n := &Note{
- Text: string(text),
- }
-
- var buf bytes.Buffer
- buf.Write(text)
-
- // Parse and verify signatures.
- // Ignore duplicate signatures.
- seen := make(map[nameHash]bool)
- seenUnverified := make(map[string]bool)
- numSig := 0
- for len(sigs) > 0 {
- // Pull out next signature line.
- // We know sigs[len(sigs)-1] == '\n', so IndexByte always finds one.
- i := bytes.IndexByte(sigs, '\n')
- line := sigs[:i]
- sigs = sigs[i+1:]
-
- if !bytes.HasPrefix(line, sigPrefix) {
- return nil, errMalformedNote
- }
- line = line[len(sigPrefix):]
- name, b64 := chop(string(line), " ")
- sig, err := base64.StdEncoding.DecodeString(b64)
- if err != nil || !isValidName(name) || b64 == "" || len(sig) < 5 {
- return nil, errMalformedNote
- }
- hash := binary.BigEndian.Uint32(sig[0:4])
- sig = sig[4:]
-
- if numSig++; numSig > 100 {
- // Avoid spending forever parsing a note with many signatures.
- return nil, errMalformedNote
- }
-
- v, err := known.Verifier(name, hash)
- if _, ok := err.(*UnknownVerifierError); ok {
- // Drop repeated identical unverified signatures.
- if seenUnverified[string(line)] {
- continue
- }
- seenUnverified[string(line)] = true
- n.UnverifiedSigs = append(n.UnverifiedSigs, Signature{Name: name, Hash: hash, Base64: b64})
- continue
- }
- if err != nil {
- return nil, err
- }
-
- // Drop repeated signatures by a single verifier.
- if seen[nameHash{name, hash}] {
- continue
- }
- seen[nameHash{name, hash}] = true
-
- ok := v.Verify(text, sig)
- if !ok {
- return nil, &InvalidSignatureError{name, hash}
- }
-
- n.Sigs = append(n.Sigs, Signature{Name: name, Hash: hash, Base64: b64})
- }
-
- // Parsed and verified all the signatures.
- if len(n.Sigs) == 0 {
- return nil, &UnverifiedNoteError{n}
- }
- return n, nil
-}
-
-// Sign signs the note with the given signers and returns the encoded message.
-// The new signatures from signers are listed in the encoded message after
-// the existing signatures already present in n.Sigs.
-// If any signer uses the same key as an existing signature,
-// the existing signature is elided from the output.
-func Sign(n *Note, signers ...Signer) ([]byte, error) {
- var buf bytes.Buffer
- if !strings.HasSuffix(n.Text, "\n") {
- return nil, errMalformedNote
- }
- buf.WriteString(n.Text)
-
- // Prepare signatures.
- var sigs bytes.Buffer
- have := make(map[nameHash]bool)
- for _, s := range signers {
- name := s.Name()
- hash := s.KeyHash()
- have[nameHash{name, hash}] = true
- if !isValidName(name) {
- return nil, errInvalidSigner
- }
-
- sig, err := s.Sign(buf.Bytes()) // buf holds n.Text
- if err != nil {
- return nil, err
- }
-
- var hbuf [4]byte
- binary.BigEndian.PutUint32(hbuf[:], hash)
- b64 := base64.StdEncoding.EncodeToString(append(hbuf[:], sig...))
- sigs.WriteString("— ")
- sigs.WriteString(name)
- sigs.WriteString(" ")
- sigs.WriteString(b64)
- sigs.WriteString("\n")
- }
-
- buf.WriteString("\n")
-
- // Emit existing signatures not replaced by new ones.
- for _, list := range [][]Signature{n.Sigs, n.UnverifiedSigs} {
- for _, sig := range list {
- name, hash := sig.Name, sig.Hash
- if !isValidName(name) {
- return nil, errMalformedNote
- }
- if have[nameHash{name, hash}] {
- continue
- }
- // Double-check hash against base64.
- raw, err := base64.StdEncoding.DecodeString(sig.Base64)
- if err != nil || len(raw) < 4 || binary.BigEndian.Uint32(raw) != hash {
- return nil, errMalformedNote
- }
- buf.WriteString("— ")
- buf.WriteString(sig.Name)
- buf.WriteString(" ")
- buf.WriteString(sig.Base64)
- buf.WriteString("\n")
- }
- }
- buf.Write(sigs.Bytes())
-
- return buf.Bytes(), nil
-}
diff --git a/libgo/go/cmd/go/internal/note/note_test.go b/libgo/go/cmd/go/internal/note/note_test.go
deleted file mode 100644
index 729324647e7..00000000000
--- a/libgo/go/cmd/go/internal/note/note_test.go
+++ /dev/null
@@ -1,472 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package note
-
-import (
- "crypto/ed25519"
- "crypto/rand"
- "errors"
- "strings"
- "testing"
- "testing/iotest"
-)
-
-func TestNewVerifier(t *testing.T) {
- vkey := "PeterNeumann+c74f20a3+ARpc2QcUPDhMQegwxbzhKqiBfsVkmqq/LDE4izWy10TW"
- _, err := NewVerifier(vkey)
- if err != nil {
- t.Fatal(err)
- }
-
- // Check various manglings are not accepted.
- badKey := func(k string) {
- _, err := NewVerifier(k)
- if err == nil {
- t.Errorf("NewVerifier(%q) succeeded, should have failed", k)
- }
- }
-
- b := []byte(vkey)
- for i := 0; i <= len(b); i++ {
- for j := i + 1; j <= len(b); j++ {
- if i != 0 || j != len(b) {
- badKey(string(b[i:j]))
- }
- }
- }
- for i := 0; i < len(b); i++ {
- b[i]++
- badKey(string(b))
- b[i]--
- }
-
- badKey("PeterNeumann+cc469956+ARpc2QcUPDhMQegwxbzhKqiBfsVkmqq/LDE4izWy10TWBADKEY==") // wrong length key, with adjusted key hash
- badKey("PeterNeumann+173116ae+ZRpc2QcUPDhMQegwxbzhKqiBfsVkmqq/LDE4izWy10TW") // unknown algorithm, with adjusted key hash
-}
-
-func TestNewSigner(t *testing.T) {
- skey := "PRIVATE+KEY+PeterNeumann+c74f20a3+AYEKFALVFGyNhPJEMzD1QIDr+Y7hfZx09iUvxdXHKDFz"
- _, err := NewSigner(skey)
- if err != nil {
- t.Fatal(err)
- }
-
- // Check various manglings are not accepted.
- b := []byte(skey)
- for i := 0; i <= len(b); i++ {
- for j := i + 1; j <= len(b); j++ {
- if i == 0 && j == len(b) {
- continue
- }
- _, err := NewSigner(string(b[i:j]))
- if err == nil {
- t.Errorf("NewSigner(%q) succeeded, should have failed", b[i:j])
- }
- }
- }
- for i := 0; i < len(b); i++ {
- b[i]++
- _, err := NewSigner(string(b))
- if err == nil {
- t.Errorf("NewSigner(%q) succeeded, should have failed", b)
- }
- b[i]--
- }
-}
-
-func testSignerAndVerifier(t *testing.T, Name string, signer Signer, verifier Verifier) {
- if name := signer.Name(); name != Name {
- t.Errorf("signer.Name() = %q, want %q", name, Name)
- }
- if name := verifier.Name(); name != Name {
- t.Errorf("verifier.Name() = %q, want %q", name, Name)
- }
- shash := signer.KeyHash()
- vhash := verifier.KeyHash()
- if shash != vhash {
- t.Errorf("signer.KeyHash() = %#08x != verifier.KeyHash() = %#08x", shash, vhash)
- }
-
- msg := []byte("hi")
- sig, err := signer.Sign(msg)
- if err != nil {
- t.Fatalf("signer.Sign: %v", err)
- }
- if !verifier.Verify(msg, sig) {
- t.Fatalf("verifier.Verify failed on signature returned by signer.Sign")
- }
- sig[0]++
- if verifier.Verify(msg, sig) {
- t.Fatalf("verifier.Verify succceeded on corrupt signature")
- }
- sig[0]--
- msg[0]++
- if verifier.Verify(msg, sig) {
- t.Fatalf("verifier.Verify succceeded on corrupt message")
- }
-}
-
-func TestGenerateKey(t *testing.T) {
- // Generate key pair, make sure it is all self-consistent.
- const Name = "EnochRoot"
-
- skey, vkey, err := GenerateKey(rand.Reader, Name)
- if err != nil {
- t.Fatalf("GenerateKey: %v", err)
- }
- signer, err := NewSigner(skey)
- if err != nil {
- t.Fatalf("NewSigner: %v", err)
- }
- verifier, err := NewVerifier(vkey)
- if err != nil {
- t.Fatalf("NewVerifier: %v", err)
- }
-
- testSignerAndVerifier(t, Name, signer, verifier)
-
- // Check that GenerateKey returns error from rand reader.
- _, _, err = GenerateKey(iotest.TimeoutReader(iotest.OneByteReader(rand.Reader)), Name)
- if err == nil {
- t.Fatalf("GenerateKey succeeded with error-returning rand reader")
- }
-}
-
-func TestFromEd25519(t *testing.T) {
- const Name = "EnochRoot"
-
- pub, priv, err := ed25519.GenerateKey(rand.Reader)
- if err != nil {
- t.Fatalf("GenerateKey: %v", err)
- }
- signer, err := newSignerFromEd25519Seed(Name, priv.Seed())
- if err != nil {
- t.Fatalf("newSignerFromEd25519Seed: %v", err)
- }
- vkey, err := NewEd25519VerifierKey(Name, pub)
- if err != nil {
- t.Fatalf("NewEd25519VerifierKey: %v", err)
- }
- verifier, err := NewVerifier(vkey)
- if err != nil {
- t.Fatalf("NewVerifier: %v", err)
- }
-
- testSignerAndVerifier(t, Name, signer, verifier)
-
- // Check that wrong key sizes return errors.
- _, err = NewEd25519VerifierKey(Name, pub[:len(pub)-1])
- if err == nil {
- t.Errorf("NewEd25519VerifierKey succeeded with a seed of the wrong size")
- }
-}
-
-// newSignerFromEd25519Seed constructs a new signer from a verifier name and a
-// crypto/ed25519 private key seed.
-func newSignerFromEd25519Seed(name string, seed []byte) (Signer, error) {
- if len(seed) != ed25519.SeedSize {
- return nil, errors.New("invalid seed size")
- }
- priv := ed25519.NewKeyFromSeed(seed)
- pub := priv[32:]
-
- pubkey := append([]byte{algEd25519}, pub...)
- hash := keyHash(name, pubkey)
-
- s := &signer{
- name: name,
- hash: uint32(hash),
- sign: func(msg []byte) ([]byte, error) {
- return ed25519.Sign(priv, msg), nil
- },
- }
- return s, nil
-}
-
-func TestSign(t *testing.T) {
- skey := "PRIVATE+KEY+PeterNeumann+c74f20a3+AYEKFALVFGyNhPJEMzD1QIDr+Y7hfZx09iUvxdXHKDFz"
- text := "If you think cryptography is the answer to your problem,\n" +
- "then you don't know what your problem is.\n"
-
- signer, err := NewSigner(skey)
- if err != nil {
- t.Fatal(err)
- }
-
- msg, err := Sign(&Note{Text: text}, signer)
- if err != nil {
- t.Fatal(err)
- }
-
- want := `If you think cryptography is the answer to your problem,
-then you don't know what your problem is.
-
-— PeterNeumann x08go/ZJkuBS9UG/SffcvIAQxVBtiFupLLr8pAcElZInNIuGUgYN1FFYC2pZSNXgKvqfqdngotpRZb6KE6RyyBwJnAM=
-`
- if string(msg) != want {
- t.Errorf("Sign: wrong output\nhave:\n%s\nwant:\n%s", msg, want)
- }
-
- // Check that existing signature is replaced by new one.
- msg, err = Sign(&Note{Text: text, Sigs: []Signature{{Name: "PeterNeumann", Hash: 0xc74f20a3, Base64: "BADSIGN="}}}, signer)
- if err != nil {
- t.Fatal(err)
- }
- if string(msg) != want {
- t.Errorf("Sign replacing signature: wrong output\nhave:\n%s\nwant:\n%s", msg, want)
- }
-
- // Check various bad inputs.
- _, err = Sign(&Note{Text: "abc"}, signer)
- if err == nil || err.Error() != "malformed note" {
- t.Fatalf("Sign with short text: %v, want malformed note error", err)
- }
-
- _, err = Sign(&Note{Text: text, Sigs: []Signature{{Name: "a+b", Base64: "ABCD"}}})
- if err == nil || err.Error() != "malformed note" {
- t.Fatalf("Sign with bad name: %v, want malformed note error", err)
- }
-
- _, err = Sign(&Note{Text: text, Sigs: []Signature{{Name: "PeterNeumann", Hash: 0xc74f20a3, Base64: "BADHASH="}}})
- if err == nil || err.Error() != "malformed note" {
- t.Fatalf("Sign with bad pre-filled signature: %v, want malformed note error", err)
- }
-
- _, err = Sign(&Note{Text: text}, &badSigner{signer})
- if err == nil || err.Error() != "invalid signer" {
- t.Fatalf("Sign with bad signer: %v, want invalid signer error", err)
- }
-
- _, err = Sign(&Note{Text: text}, &errSigner{signer})
- if err != errSurprise {
- t.Fatalf("Sign with failing signer: %v, want errSurprise", err)
- }
-}
-
-func TestVerifierList(t *testing.T) {
- peterKey := "PeterNeumann+c74f20a3+ARpc2QcUPDhMQegwxbzhKqiBfsVkmqq/LDE4izWy10TW"
- peterVerifier, err := NewVerifier(peterKey)
- if err != nil {
- t.Fatal(err)
- }
-
- enochKey := "EnochRoot+af0cfe78+ATtqJ7zOtqQtYqOo0CpvDXNlMhV3HeJDpjrASKGLWdop"
- enochVerifier, err := NewVerifier(enochKey)
- if err != nil {
- t.Fatal(err)
- }
-
- list := VerifierList(peterVerifier, enochVerifier, enochVerifier)
- v, err := list.Verifier("PeterNeumann", 0xc74f20a3)
- if v != peterVerifier || err != nil {
- t.Fatalf("list.Verifier(peter) = %v, %v, want %v, nil", v, err, peterVerifier)
- }
- v, err = list.Verifier("PeterNeumann", 0xc74f20a4)
- if v != nil || err == nil || err.Error() != "unknown key PeterNeumann+c74f20a4" {
- t.Fatalf("list.Verifier(peter bad hash) = %v, %v, want nil, unknown key error", v, err)
- }
-
- v, err = list.Verifier("PeterNeuman", 0xc74f20a3)
- if v != nil || err == nil || err.Error() != "unknown key PeterNeuman+c74f20a3" {
- t.Fatalf("list.Verifier(peter bad name) = %v, %v, want nil, unknown key error", v, err)
- }
- v, err = list.Verifier("EnochRoot", 0xaf0cfe78)
- if v != nil || err == nil || err.Error() != "ambiguous key EnochRoot+af0cfe78" {
- t.Fatalf("list.Verifier(enoch) = %v, %v, want nil, ambiguous key error", v, err)
- }
-}
-
-type badSigner struct {
- Signer
-}
-
-func (b *badSigner) Name() string {
- return "bad name"
-}
-
-var errSurprise = errors.New("surprise!")
-
-type errSigner struct {
- Signer
-}
-
-func (e *errSigner) Sign([]byte) ([]byte, error) {
- return nil, errSurprise
-}
-
-func TestOpen(t *testing.T) {
- peterKey := "PeterNeumann+c74f20a3+ARpc2QcUPDhMQegwxbzhKqiBfsVkmqq/LDE4izWy10TW"
- peterVerifier, err := NewVerifier(peterKey)
- if err != nil {
- t.Fatal(err)
- }
-
- enochKey := "EnochRoot+af0cfe78+ATtqJ7zOtqQtYqOo0CpvDXNlMhV3HeJDpjrASKGLWdop"
- enochVerifier, err := NewVerifier(enochKey)
- if err != nil {
- t.Fatal(err)
- }
-
- text := `If you think cryptography is the answer to your problem,
-then you don't know what your problem is.
-`
- peterSig := "— PeterNeumann x08go/ZJkuBS9UG/SffcvIAQxVBtiFupLLr8pAcElZInNIuGUgYN1FFYC2pZSNXgKvqfqdngotpRZb6KE6RyyBwJnAM=\n"
- enochSig := "— EnochRoot rwz+eBzmZa0SO3NbfRGzPCpDckykFXSdeX+MNtCOXm2/5n2tiOHp+vAF1aGrQ5ovTG01oOTGwnWLox33WWd1RvMc+QQ=\n"
-
- peter := Signature{"PeterNeumann", 0xc74f20a3, "x08go/ZJkuBS9UG/SffcvIAQxVBtiFupLLr8pAcElZInNIuGUgYN1FFYC2pZSNXgKvqfqdngotpRZb6KE6RyyBwJnAM="}
- enoch := Signature{"EnochRoot", 0xaf0cfe78, "rwz+eBzmZa0SO3NbfRGzPCpDckykFXSdeX+MNtCOXm2/5n2tiOHp+vAF1aGrQ5ovTG01oOTGwnWLox33WWd1RvMc+QQ="}
-
- // Check one signature verified, one not.
- n, err := Open([]byte(text+"\n"+peterSig+enochSig), VerifierList(peterVerifier))
- if err != nil {
- t.Fatal(err)
- }
- if n.Text != text {
- t.Errorf("n.Text = %q, want %q", n.Text, text)
- }
- if len(n.Sigs) != 1 || n.Sigs[0] != peter {
- t.Errorf("n.Sigs:\nhave %v\nwant %v", n.Sigs, []Signature{peter})
- }
- if len(n.UnverifiedSigs) != 1 || n.UnverifiedSigs[0] != enoch {
- t.Errorf("n.UnverifiedSigs:\nhave %v\nwant %v", n.Sigs, []Signature{peter})
- }
-
- // Check both verified.
- n, err = Open([]byte(text+"\n"+peterSig+enochSig), VerifierList(peterVerifier, enochVerifier))
- if err != nil {
- t.Fatal(err)
- }
- if len(n.Sigs) != 2 || n.Sigs[0] != peter || n.Sigs[1] != enoch {
- t.Errorf("n.Sigs:\nhave %v\nwant %v", n.Sigs, []Signature{peter, enoch})
- }
- if len(n.UnverifiedSigs) != 0 {
- t.Errorf("n.UnverifiedSigs:\nhave %v\nwant %v", n.Sigs, []Signature{})
- }
-
- // Check both unverified.
- n, err = Open([]byte(text+"\n"+peterSig+enochSig), VerifierList())
- if n != nil || err == nil {
- t.Fatalf("Open unverified = %v, %v, want nil, error", n, err)
- }
- e, ok := err.(*UnverifiedNoteError)
- if !ok {
- t.Fatalf("Open unverified: err is %T, want *UnverifiedNoteError", err)
- }
- if err.Error() != "note has no verifiable signatures" {
- t.Fatalf("Open unverified: err.Error() = %q, want %q", err.Error(), "note has no verifiable signatures")
- }
-
- n = e.Note
- if n == nil {
- t.Fatalf("Open unverified: missing note in UnverifiedNoteError")
- }
- if len(n.Sigs) != 0 {
- t.Errorf("n.Sigs:\nhave %v\nwant %v", n.Sigs, []Signature{})
- }
- if len(n.UnverifiedSigs) != 2 || n.UnverifiedSigs[0] != peter || n.UnverifiedSigs[1] != enoch {
- t.Errorf("n.UnverifiedSigs:\nhave %v\nwant %v", n.Sigs, []Signature{peter, enoch})
- }
-
- // Check duplicated verifier.
- _, err = Open([]byte(text+"\n"+enochSig), VerifierList(enochVerifier, peterVerifier, enochVerifier))
- if err == nil || err.Error() != "ambiguous key EnochRoot+af0cfe78" {
- t.Fatalf("Open with duplicated verifier: err=%v, want ambiguous key", err)
- }
-
- // Check unused duplicated verifier.
- _, err = Open([]byte(text+"\n"+peterSig), VerifierList(enochVerifier, peterVerifier, enochVerifier))
- if err != nil {
- t.Fatal(err)
- }
-
- // Check too many signatures.
- n, err = Open([]byte(text+"\n"+strings.Repeat(peterSig, 101)), VerifierList(peterVerifier))
- if n != nil || err == nil || err.Error() != "malformed note" {
- t.Fatalf("Open too many verified signatures = %v, %v, want nil, malformed note error", n, err)
- }
- n, err = Open([]byte(text+"\n"+strings.Repeat(peterSig, 101)), VerifierList())
- if n != nil || err == nil || err.Error() != "malformed note" {
- t.Fatalf("Open too many verified signatures = %v, %v, want nil, malformed note error", n, err)
- }
-
- // Invalid signature.
- n, err = Open([]byte(text+"\n"+peterSig[:60]+"ABCD"+peterSig[60:]), VerifierList(peterVerifier))
- if n != nil || err == nil || err.Error() != "invalid signature for key PeterNeumann+c74f20a3" {
- t.Fatalf("Open too many verified signatures = %v, %v, want nil, invalid signature error", n, err)
- }
-
- // Duplicated verified and unverified signatures.
- enochABCD := Signature{"EnochRoot", 0xaf0cfe78, "rwz+eBzmZa0SO3NbfRGzPCpDckykFXSdeX+MNtCOXm2/5n" + "ABCD" + "2tiOHp+vAF1aGrQ5ovTG01oOTGwnWLox33WWd1RvMc+QQ="}
- n, err = Open([]byte(text+"\n"+peterSig+peterSig+enochSig+enochSig+enochSig[:60]+"ABCD"+enochSig[60:]), VerifierList(peterVerifier))
- if err != nil {
- t.Fatal(err)
- }
- if len(n.Sigs) != 1 || n.Sigs[0] != peter {
- t.Errorf("n.Sigs:\nhave %v\nwant %v", n.Sigs, []Signature{peter})
- }
- if len(n.UnverifiedSigs) != 2 || n.UnverifiedSigs[0] != enoch || n.UnverifiedSigs[1] != enochABCD {
- t.Errorf("n.UnverifiedSigs:\nhave %v\nwant %v", n.UnverifiedSigs, []Signature{enoch, enochABCD})
- }
-
- // Invalid encoded message syntax.
- badMsgs := []string{
- text,
- text + "\n",
- text + "\n" + peterSig[:len(peterSig)-1],
- "\x01" + text + "\n" + peterSig,
- "\xff" + text + "\n" + peterSig,
- text + "\n" + "— Bad Name x08go/ZJkuBS9UG/SffcvIAQxVBtiFupLLr8pAcElZInNIuGUgYN1FFYC2pZSNXgKvqfqdngotpRZb6KE6RyyBwJnAM=",
- text + "\n" + peterSig + "Unexpected line.\n",
- }
- for _, msg := range badMsgs {
- n, err := Open([]byte(msg), VerifierList(peterVerifier))
- if n != nil || err == nil || err.Error() != "malformed note" {
- t.Fatalf("Open bad msg = %v, %v, want nil, malformed note error\nmsg:\n%s", n, err, msg)
- }
- }
-}
-
-func BenchmarkOpen(b *testing.B) {
- vkey := "PeterNeumann+c74f20a3+ARpc2QcUPDhMQegwxbzhKqiBfsVkmqq/LDE4izWy10TW"
- msg := []byte("If you think cryptography is the answer to your problem,\n" +
- "then you don't know what your problem is.\n" +
- "\n" +
- "— PeterNeumann x08go/ZJkuBS9UG/SffcvIAQxVBtiFupLLr8pAcElZInNIuGUgYN1FFYC2pZSNXgKvqfqdngotpRZb6KE6RyyBwJnAM=\n")
-
- verifier, err := NewVerifier(vkey)
- if err != nil {
- b.Fatal(err)
- }
- verifiers := VerifierList(verifier)
- verifiers0 := VerifierList()
-
- // Try with 0 signatures and 1 signature so we can tell how much each signature adds.
-
- b.Run("Sig0", func(b *testing.B) {
- for i := 0; i < b.N; i++ {
- _, err := Open(msg, verifiers0)
- e, ok := err.(*UnverifiedNoteError)
- if !ok {
- b.Fatal("expected UnverifiedNoteError")
- }
- n := e.Note
- if len(n.Sigs) != 0 || len(n.UnverifiedSigs) != 1 {
- b.Fatal("wrong signature count")
- }
- }
- })
-
- b.Run("Sig1", func(b *testing.B) {
- for i := 0; i < b.N; i++ {
- n, err := Open(msg, verifiers)
- if err != nil {
- b.Fatal(err)
- }
- if len(n.Sigs) != 1 || len(n.UnverifiedSigs) != 0 {
- b.Fatal("wrong signature count")
- }
- }
- })
-}
diff --git a/libgo/go/cmd/go/internal/renameio/renameio_test.go b/libgo/go/cmd/go/internal/renameio/renameio_test.go
index 81dba6d5451..ee2f3ba1bb8 100644
--- a/libgo/go/cmd/go/internal/renameio/renameio_test.go
+++ b/libgo/go/cmd/go/internal/renameio/renameio_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//+build !plan9
+// +build !plan9
package renameio
@@ -131,10 +131,18 @@ func TestConcurrentReadsAndWrites(t *testing.T) {
}
var minReadSuccesses int64 = attempts
- if runtime.GOOS == "windows" {
+
+ switch runtime.GOOS {
+ case "windows":
// Windows produces frequent "Access is denied" errors under heavy rename load.
- // As long as those are the only errors and *some* of the writes succeed, we're happy.
+ // As long as those are the only errors and *some* of the reads succeed, we're happy.
minReadSuccesses = attempts / 4
+
+ case "darwin":
+ // The filesystem on macOS 10.14 occasionally fails with "no such file or
+ // directory" errors. See https://golang.org/issue/33041. The flake rate is
+ // fairly low, so ensure that at least 75% of attempts succeed.
+ minReadSuccesses = attempts - (attempts / 4)
}
if readSuccesses < minReadSuccesses {
diff --git a/libgo/go/cmd/go/internal/renameio/umask_test.go b/libgo/go/cmd/go/internal/renameio/umask_test.go
index 1a471c9e4e6..d75d67c9a93 100644
--- a/libgo/go/cmd/go/internal/renameio/umask_test.go
+++ b/libgo/go/cmd/go/internal/renameio/umask_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//+build !nacl,!plan9,!windows,!js
+// +build !plan9,!windows,!js
package renameio
@@ -19,6 +19,7 @@ func TestWriteFileModeAppliesUmask(t *testing.T) {
if err != nil {
t.Fatalf("Failed to create temporary directory: %v", err)
}
+ defer os.RemoveAll(dir)
const mode = 0644
const umask = 0007
@@ -29,7 +30,6 @@ func TestWriteFileModeAppliesUmask(t *testing.T) {
if err != nil {
t.Fatalf("Failed to write file: %v", err)
}
- defer os.RemoveAll(dir)
fi, err := os.Stat(file)
if err != nil {
diff --git a/libgo/go/cmd/go/internal/robustio/robustio_darwin.go b/libgo/go/cmd/go/internal/robustio/robustio_darwin.go
new file mode 100644
index 00000000000..99fd8ebc2ff
--- /dev/null
+++ b/libgo/go/cmd/go/internal/robustio/robustio_darwin.go
@@ -0,0 +1,21 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package robustio
+
+import (
+ "errors"
+ "syscall"
+)
+
+const errFileNotFound = syscall.ENOENT
+
+// isEphemeralError returns true if err may be resolved by waiting.
+func isEphemeralError(err error) bool {
+ var errno syscall.Errno
+ if errors.As(err, &errno) {
+ return errno == errFileNotFound
+ }
+ return false
+}
diff --git a/libgo/go/cmd/go/internal/robustio/robustio_flaky.go b/libgo/go/cmd/go/internal/robustio/robustio_flaky.go
new file mode 100644
index 00000000000..e57c8c74c4c
--- /dev/null
+++ b/libgo/go/cmd/go/internal/robustio/robustio_flaky.go
@@ -0,0 +1,92 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build windows darwin
+
+package robustio
+
+import (
+ "errors"
+ "io/ioutil"
+ "math/rand"
+ "os"
+ "syscall"
+ "time"
+)
+
+const arbitraryTimeout = 500 * time.Millisecond
+
+// retry retries ephemeral errors from f up to an arbitrary timeout
+// to work around filesystem flakiness on Windows and Darwin.
+func retry(f func() (err error, mayRetry bool)) error {
+ var (
+ bestErr error
+ lowestErrno syscall.Errno
+ start time.Time
+ nextSleep time.Duration = 1 * time.Millisecond
+ )
+ for {
+ err, mayRetry := f()
+ if err == nil || !mayRetry {
+ return err
+ }
+
+ var errno syscall.Errno
+ if errors.As(err, &errno) && (lowestErrno == 0 || errno < lowestErrno) {
+ bestErr = err
+ lowestErrno = errno
+ } else if bestErr == nil {
+ bestErr = err
+ }
+
+ if start.IsZero() {
+ start = time.Now()
+ } else if d := time.Since(start) + nextSleep; d >= arbitraryTimeout {
+ break
+ }
+ time.Sleep(nextSleep)
+ nextSleep += time.Duration(rand.Int63n(int64(nextSleep)))
+ }
+
+ return bestErr
+}
+
+// rename is like os.Rename, but retries ephemeral errors.
+//
+// On Windows it wraps os.Rename, which (as of 2019-06-04) uses MoveFileEx with
+// MOVEFILE_REPLACE_EXISTING.
+//
+// Windows also provides a different system call, ReplaceFile,
+// that provides similar semantics, but perhaps preserves more metadata. (The
+// documentation on the differences between the two is very sparse.)
+//
+// Empirical error rates with MoveFileEx are lower under modest concurrency, so
+// for now we're sticking with what the os package already provides.
+func rename(oldpath, newpath string) (err error) {
+ return retry(func() (err error, mayRetry bool) {
+ err = os.Rename(oldpath, newpath)
+ return err, isEphemeralError(err)
+ })
+}
+
+// readFile is like ioutil.ReadFile, but retries ephemeral errors.
+func readFile(filename string) ([]byte, error) {
+ var b []byte
+ err := retry(func() (err error, mayRetry bool) {
+ b, err = ioutil.ReadFile(filename)
+
+ // Unlike in rename, we do not retry errFileNotFound here: it can occur
+ // as a spurious error, but the file may also genuinely not exist, so the
+ // increase in robustness is probably not worth the extra latency.
+ return err, isEphemeralError(err) && !errors.Is(err, errFileNotFound)
+ })
+ return b, err
+}
+
+func removeAll(path string) error {
+ return retry(func() (err error, mayRetry bool) {
+ err = os.RemoveAll(path)
+ return err, isEphemeralError(err)
+ })
+}
diff --git a/libgo/go/cmd/go/internal/robustio/robustio_other.go b/libgo/go/cmd/go/internal/robustio/robustio_other.go
index 91ca56cb82c..907b5568587 100644
--- a/libgo/go/cmd/go/internal/robustio/robustio_other.go
+++ b/libgo/go/cmd/go/internal/robustio/robustio_other.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//+build !windows
+// +build !windows,!darwin
package robustio
diff --git a/libgo/go/cmd/go/internal/robustio/robustio_windows.go b/libgo/go/cmd/go/internal/robustio/robustio_windows.go
index a3d94e566fe..687dcb66f83 100644
--- a/libgo/go/cmd/go/internal/robustio/robustio_windows.go
+++ b/libgo/go/cmd/go/internal/robustio/robustio_windows.go
@@ -7,88 +7,10 @@ package robustio
import (
"errors"
"internal/syscall/windows"
- "io/ioutil"
- "math/rand"
- "os"
"syscall"
- "time"
)
-const arbitraryTimeout = 500 * time.Millisecond
-
-// retry retries ephemeral errors from f up to an arbitrary timeout
-// to work around spurious filesystem errors on Windows
-func retry(f func() (err error, mayRetry bool)) error {
- var (
- bestErr error
- lowestErrno syscall.Errno
- start time.Time
- nextSleep time.Duration = 1 * time.Millisecond
- )
- for {
- err, mayRetry := f()
- if err == nil || !mayRetry {
- return err
- }
-
- var errno syscall.Errno
- if errors.As(err, &errno) && (lowestErrno == 0 || errno < lowestErrno) {
- bestErr = err
- lowestErrno = errno
- } else if bestErr == nil {
- bestErr = err
- }
-
- if start.IsZero() {
- start = time.Now()
- } else if d := time.Since(start) + nextSleep; d >= arbitraryTimeout {
- break
- }
- time.Sleep(nextSleep)
- nextSleep += time.Duration(rand.Int63n(int64(nextSleep)))
- }
-
- return bestErr
-}
-
-// rename is like os.Rename, but retries ephemeral errors.
-//
-// It wraps os.Rename, which (as of 2019-06-04) uses MoveFileEx with
-// MOVEFILE_REPLACE_EXISTING.
-//
-// Windows also provides a different system call, ReplaceFile,
-// that provides similar semantics, but perhaps preserves more metadata. (The
-// documentation on the differences between the two is very sparse.)
-//
-// Empirical error rates with MoveFileEx are lower under modest concurrency, so
-// for now we're sticking with what the os package already provides.
-func rename(oldpath, newpath string) (err error) {
- return retry(func() (err error, mayRetry bool) {
- err = os.Rename(oldpath, newpath)
- return err, isEphemeralError(err)
- })
-}
-
-// readFile is like ioutil.ReadFile, but retries ephemeral errors.
-func readFile(filename string) ([]byte, error) {
- var b []byte
- err := retry(func() (err error, mayRetry bool) {
- b, err = ioutil.ReadFile(filename)
-
- // Unlike in rename, we do not retry ERROR_FILE_NOT_FOUND here: it can occur
- // as a spurious error, but the file may also genuinely not exist, so the
- // increase in robustness is probably not worth the extra latency.
- return err, isEphemeralError(err) && !errors.Is(err, syscall.ERROR_FILE_NOT_FOUND)
- })
- return b, err
-}
-
-func removeAll(path string) error {
- return retry(func() (err error, mayRetry bool) {
- err = os.RemoveAll(path)
- return err, isEphemeralError(err)
- })
-}
+const errFileNotFound = syscall.ERROR_FILE_NOT_FOUND
// isEphemeralError returns true if err may be resolved by waiting.
func isEphemeralError(err error) bool {
diff --git a/libgo/go/cmd/go/internal/run/run.go b/libgo/go/cmd/go/internal/run/run.go
index 71da5adc934..2edae38ccaa 100644
--- a/libgo/go/cmd/go/internal/run/run.go
+++ b/libgo/go/cmd/go/internal/run/run.go
@@ -33,7 +33,7 @@ If the -exec flag is given, 'go run' invokes the binary using xprog:
If the -exec flag is not given, GOOS or GOARCH is different from the system
default, and a program named go_$GOOS_$GOARCH_exec can be found
on the current search path, 'go run' invokes the binary using that program,
-for example 'go_nacl_386_exec a.out arguments...'. This allows execution of
+for example 'go_js_wasm_exec a.out arguments...'. This allows execution of
cross-compiled programs when a simulator or other execution method is
available.
@@ -49,7 +49,7 @@ See also: go build.
func init() {
CmdRun.Run = runRun // break init loop
- work.AddBuildFlags(CmdRun)
+ work.AddBuildFlags(CmdRun, work.DefaultBuildFlags)
CmdRun.Flag.Var((*base.StringsFlag)(&work.ExecCmd), "exec", "")
}
diff --git a/libgo/go/cmd/go/internal/search/search.go b/libgo/go/cmd/go/internal/search/search.go
index 0167c8d7550..ad33e60af14 100644
--- a/libgo/go/cmd/go/internal/search/search.go
+++ b/libgo/go/cmd/go/internal/search/search.go
@@ -125,32 +125,43 @@ func SetModRoot(dir string) {
modRoot = dir
}
-// MatchPackagesInFS is like allPackages but is passed a pattern
-// beginning ./ or ../, meaning it should scan the tree rooted
-// at the given directory. There are ... in the pattern too.
-// (See go help packages for pattern syntax.)
+// MatchPackagesInFS is like MatchPackages but is passed a pattern that
+// begins with an absolute path or "./" or "../". On Windows, the pattern may
+// use slash or backslash separators or a mix of both.
+//
+// MatchPackagesInFS scans the tree rooted at the directory that contains the
+// first "..." wildcard and returns a match with packages that
func MatchPackagesInFS(pattern string) *Match {
m := &Match{
Pattern: pattern,
Literal: false,
}
+ // Clean the path and create a matching predicate.
+ // filepath.Clean removes "./" prefixes (and ".\" on Windows). We need to
+ // preserve these, since they are meaningful in MatchPattern and in
+ // returned import paths.
+ cleanPattern := filepath.Clean(pattern)
+ isLocal := strings.HasPrefix(pattern, "./") || (os.PathSeparator == '\\' && strings.HasPrefix(pattern, `.\`))
+ prefix := ""
+ if cleanPattern != "." && isLocal {
+ prefix = "./"
+ cleanPattern = "." + string(os.PathSeparator) + cleanPattern
+ }
+ slashPattern := filepath.ToSlash(cleanPattern)
+ match := MatchPattern(slashPattern)
+
// Find directory to begin the scan.
// Could be smarter but this one optimization
// is enough for now, since ... is usually at the
// end of a path.
- i := strings.Index(pattern, "...")
- dir, _ := path.Split(pattern[:i])
+ i := strings.Index(cleanPattern, "...")
+ dir, _ := filepath.Split(cleanPattern[:i])
// pattern begins with ./ or ../.
// path.Clean will discard the ./ but not the ../.
// We need to preserve the ./ for pattern matching
// and in the returned import paths.
- prefix := ""
- if strings.HasPrefix(pattern, "./") {
- prefix = "./"
- }
- match := MatchPattern(pattern)
if modRoot != "" {
abs, err := filepath.Abs(dir)
@@ -241,7 +252,7 @@ func TreeCanMatchPattern(pattern string) func(name string) bool {
//
// First, /... at the end of the pattern can match an empty string,
// so that net/... matches both net and packages in its subdirectories, like net/http.
-// Second, any slash-separted pattern element containing a wildcard never
+// Second, any slash-separated pattern element containing a wildcard never
// participates in a match of the "vendor" element in the path of a vendored
// package, so that ./... does not match packages in subdirectories of
// ./vendor or ./mycode/vendor, but ./vendor/... and ./mycode/vendor/... do.
@@ -361,32 +372,49 @@ func ImportPathsQuiet(patterns []string) []*Match {
return out
}
-// CleanPatterns returns the patterns to use for the given
-// command line. It canonicalizes the patterns but does not
-// evaluate any matches.
+// CleanPatterns returns the patterns to use for the given command line. It
+// canonicalizes the patterns but does not evaluate any matches. For patterns
+// that are not local or absolute paths, it preserves text after '@' to avoid
+// modifying version queries.
func CleanPatterns(patterns []string) []string {
if len(patterns) == 0 {
return []string{"."}
}
var out []string
for _, a := range patterns {
- // Arguments are supposed to be import paths, but
- // as a courtesy to Windows developers, rewrite \ to /
- // in command-line arguments. Handles .\... and so on.
- if filepath.Separator == '\\' {
- a = strings.ReplaceAll(a, `\`, `/`)
+ var p, v string
+ if build.IsLocalImport(a) || filepath.IsAbs(a) {
+ p = a
+ } else if i := strings.IndexByte(a, '@'); i < 0 {
+ p = a
+ } else {
+ p = a[:i]
+ v = a[i:]
}
- // Put argument in canonical form, but preserve leading ./.
- if strings.HasPrefix(a, "./") {
- a = "./" + path.Clean(a)
- if a == "./." {
- a = "."
- }
+ // Arguments may be either file paths or import paths.
+ // As a courtesy to Windows developers, rewrite \ to /
+ // in arguments that look like import paths.
+ // Don't replace slashes in absolute paths.
+ if filepath.IsAbs(p) {
+ p = filepath.Clean(p)
} else {
- a = path.Clean(a)
+ if filepath.Separator == '\\' {
+ p = strings.ReplaceAll(p, `\`, `/`)
+ }
+
+ // Put argument in canonical form, but preserve leading ./.
+ if strings.HasPrefix(p, "./") {
+ p = "./" + path.Clean(p)
+ if p == "./." {
+ p = "."
+ }
+ } else {
+ p = path.Clean(p)
+ }
}
- out = append(out, a)
+
+ out = append(out, p+v)
}
return out
}
diff --git a/libgo/go/cmd/go/internal/search/search_test.go b/libgo/go/cmd/go/internal/search/search_test.go
index 0bef765fa45..5f27daf3fb8 100644
--- a/libgo/go/cmd/go/internal/search/search_test.go
+++ b/libgo/go/cmd/go/internal/search/search_test.go
@@ -33,7 +33,7 @@ var matchPatternTests = `
match net net/http
not not/http not/net/http netchan
- # Second, any slash-separted pattern element containing a wildcard never
+ # Second, any slash-separated pattern element containing a wildcard never
# participates in a match of the "vendor" element in the path of a vendored
# package, so that ./... does not match packages in subdirectories of
# ./vendor or ./mycode/vendor, but ./vendor/... and ./mycode/vendor/... do.
diff --git a/libgo/go/cmd/go/internal/semver/semver.go b/libgo/go/cmd/go/internal/semver/semver.go
deleted file mode 100644
index 122e612dd4b..00000000000
--- a/libgo/go/cmd/go/internal/semver/semver.go
+++ /dev/null
@@ -1,388 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package semver implements comparison of semantic version strings.
-// In this package, semantic version strings must begin with a leading "v",
-// as in "v1.0.0".
-//
-// The general form of a semantic version string accepted by this package is
-//
-// vMAJOR[.MINOR[.PATCH[-PRERELEASE][+BUILD]]]
-//
-// where square brackets indicate optional parts of the syntax;
-// MAJOR, MINOR, and PATCH are decimal integers without extra leading zeros;
-// PRERELEASE and BUILD are each a series of non-empty dot-separated identifiers
-// using only alphanumeric characters and hyphens; and
-// all-numeric PRERELEASE identifiers must not have leading zeros.
-//
-// This package follows Semantic Versioning 2.0.0 (see semver.org)
-// with two exceptions. First, it requires the "v" prefix. Second, it recognizes
-// vMAJOR and vMAJOR.MINOR (with no prerelease or build suffixes)
-// as shorthands for vMAJOR.0.0 and vMAJOR.MINOR.0.
-package semver
-
-// parsed returns the parsed form of a semantic version string.
-type parsed struct {
- major string
- minor string
- patch string
- short string
- prerelease string
- build string
- err string
-}
-
-// IsValid reports whether v is a valid semantic version string.
-func IsValid(v string) bool {
- _, ok := parse(v)
- return ok
-}
-
-// Canonical returns the canonical formatting of the semantic version v.
-// It fills in any missing .MINOR or .PATCH and discards build metadata.
-// Two semantic versions compare equal only if their canonical formattings
-// are identical strings.
-// The canonical invalid semantic version is the empty string.
-func Canonical(v string) string {
- p, ok := parse(v)
- if !ok {
- return ""
- }
- if p.build != "" {
- return v[:len(v)-len(p.build)]
- }
- if p.short != "" {
- return v + p.short
- }
- return v
-}
-
-// Major returns the major version prefix of the semantic version v.
-// For example, Major("v2.1.0") == "v2".
-// If v is an invalid semantic version string, Major returns the empty string.
-func Major(v string) string {
- pv, ok := parse(v)
- if !ok {
- return ""
- }
- return v[:1+len(pv.major)]
-}
-
-// MajorMinor returns the major.minor version prefix of the semantic version v.
-// For example, MajorMinor("v2.1.0") == "v2.1".
-// If v is an invalid semantic version string, MajorMinor returns the empty string.
-func MajorMinor(v string) string {
- pv, ok := parse(v)
- if !ok {
- return ""
- }
- i := 1 + len(pv.major)
- if j := i + 1 + len(pv.minor); j <= len(v) && v[i] == '.' && v[i+1:j] == pv.minor {
- return v[:j]
- }
- return v[:i] + "." + pv.minor
-}
-
-// Prerelease returns the prerelease suffix of the semantic version v.
-// For example, Prerelease("v2.1.0-pre+meta") == "-pre".
-// If v is an invalid semantic version string, Prerelease returns the empty string.
-func Prerelease(v string) string {
- pv, ok := parse(v)
- if !ok {
- return ""
- }
- return pv.prerelease
-}
-
-// Build returns the build suffix of the semantic version v.
-// For example, Build("v2.1.0+meta") == "+meta".
-// If v is an invalid semantic version string, Build returns the empty string.
-func Build(v string) string {
- pv, ok := parse(v)
- if !ok {
- return ""
- }
- return pv.build
-}
-
-// Compare returns an integer comparing two versions according to
-// according to semantic version precedence.
-// The result will be 0 if v == w, -1 if v < w, or +1 if v > w.
-//
-// An invalid semantic version string is considered less than a valid one.
-// All invalid semantic version strings compare equal to each other.
-func Compare(v, w string) int {
- pv, ok1 := parse(v)
- pw, ok2 := parse(w)
- if !ok1 && !ok2 {
- return 0
- }
- if !ok1 {
- return -1
- }
- if !ok2 {
- return +1
- }
- if c := compareInt(pv.major, pw.major); c != 0 {
- return c
- }
- if c := compareInt(pv.minor, pw.minor); c != 0 {
- return c
- }
- if c := compareInt(pv.patch, pw.patch); c != 0 {
- return c
- }
- return comparePrerelease(pv.prerelease, pw.prerelease)
-}
-
-// Max canonicalizes its arguments and then returns the version string
-// that compares greater.
-func Max(v, w string) string {
- v = Canonical(v)
- w = Canonical(w)
- if Compare(v, w) > 0 {
- return v
- }
- return w
-}
-
-func parse(v string) (p parsed, ok bool) {
- if v == "" || v[0] != 'v' {
- p.err = "missing v prefix"
- return
- }
- p.major, v, ok = parseInt(v[1:])
- if !ok {
- p.err = "bad major version"
- return
- }
- if v == "" {
- p.minor = "0"
- p.patch = "0"
- p.short = ".0.0"
- return
- }
- if v[0] != '.' {
- p.err = "bad minor prefix"
- ok = false
- return
- }
- p.minor, v, ok = parseInt(v[1:])
- if !ok {
- p.err = "bad minor version"
- return
- }
- if v == "" {
- p.patch = "0"
- p.short = ".0"
- return
- }
- if v[0] != '.' {
- p.err = "bad patch prefix"
- ok = false
- return
- }
- p.patch, v, ok = parseInt(v[1:])
- if !ok {
- p.err = "bad patch version"
- return
- }
- if len(v) > 0 && v[0] == '-' {
- p.prerelease, v, ok = parsePrerelease(v)
- if !ok {
- p.err = "bad prerelease"
- return
- }
- }
- if len(v) > 0 && v[0] == '+' {
- p.build, v, ok = parseBuild(v)
- if !ok {
- p.err = "bad build"
- return
- }
- }
- if v != "" {
- p.err = "junk on end"
- ok = false
- return
- }
- ok = true
- return
-}
-
-func parseInt(v string) (t, rest string, ok bool) {
- if v == "" {
- return
- }
- if v[0] < '0' || '9' < v[0] {
- return
- }
- i := 1
- for i < len(v) && '0' <= v[i] && v[i] <= '9' {
- i++
- }
- if v[0] == '0' && i != 1 {
- return
- }
- return v[:i], v[i:], true
-}
-
-func parsePrerelease(v string) (t, rest string, ok bool) {
- // "A pre-release version MAY be denoted by appending a hyphen and
- // a series of dot separated identifiers immediately following the patch version.
- // Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-].
- // Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes."
- if v == "" || v[0] != '-' {
- return
- }
- i := 1
- start := 1
- for i < len(v) && v[i] != '+' {
- if !isIdentChar(v[i]) && v[i] != '.' {
- return
- }
- if v[i] == '.' {
- if start == i || isBadNum(v[start:i]) {
- return
- }
- start = i + 1
- }
- i++
- }
- if start == i || isBadNum(v[start:i]) {
- return
- }
- return v[:i], v[i:], true
-}
-
-func parseBuild(v string) (t, rest string, ok bool) {
- if v == "" || v[0] != '+' {
- return
- }
- i := 1
- start := 1
- for i < len(v) {
- if !isIdentChar(v[i]) && v[i] != '.' {
- return
- }
- if v[i] == '.' {
- if start == i {
- return
- }
- start = i + 1
- }
- i++
- }
- if start == i {
- return
- }
- return v[:i], v[i:], true
-}
-
-func isIdentChar(c byte) bool {
- return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' || c == '-'
-}
-
-func isBadNum(v string) bool {
- i := 0
- for i < len(v) && '0' <= v[i] && v[i] <= '9' {
- i++
- }
- return i == len(v) && i > 1 && v[0] == '0'
-}
-
-func isNum(v string) bool {
- i := 0
- for i < len(v) && '0' <= v[i] && v[i] <= '9' {
- i++
- }
- return i == len(v)
-}
-
-func compareInt(x, y string) int {
- if x == y {
- return 0
- }
- if len(x) < len(y) {
- return -1
- }
- if len(x) > len(y) {
- return +1
- }
- if x < y {
- return -1
- } else {
- return +1
- }
-}
-
-func comparePrerelease(x, y string) int {
- // "When major, minor, and patch are equal, a pre-release version has
- // lower precedence than a normal version.
- // Example: 1.0.0-alpha < 1.0.0.
- // Precedence for two pre-release versions with the same major, minor,
- // and patch version MUST be determined by comparing each dot separated
- // identifier from left to right until a difference is found as follows:
- // identifiers consisting of only digits are compared numerically and
- // identifiers with letters or hyphens are compared lexically in ASCII
- // sort order. Numeric identifiers always have lower precedence than
- // non-numeric identifiers. A larger set of pre-release fields has a
- // higher precedence than a smaller set, if all of the preceding
- // identifiers are equal.
- // Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta <
- // 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0."
- if x == y {
- return 0
- }
- if x == "" {
- return +1
- }
- if y == "" {
- return -1
- }
- for x != "" && y != "" {
- x = x[1:] // skip - or .
- y = y[1:] // skip - or .
- var dx, dy string
- dx, x = nextIdent(x)
- dy, y = nextIdent(y)
- if dx != dy {
- ix := isNum(dx)
- iy := isNum(dy)
- if ix != iy {
- if ix {
- return -1
- } else {
- return +1
- }
- }
- if ix {
- if len(dx) < len(dy) {
- return -1
- }
- if len(dx) > len(dy) {
- return +1
- }
- }
- if dx < dy {
- return -1
- } else {
- return +1
- }
- }
- }
- if x == "" {
- return -1
- } else {
- return +1
- }
-}
-
-func nextIdent(x string) (dx, rest string) {
- i := 0
- for i < len(x) && x[i] != '.' {
- i++
- }
- return x[:i], x[i:]
-}
diff --git a/libgo/go/cmd/go/internal/semver/semver_test.go b/libgo/go/cmd/go/internal/semver/semver_test.go
deleted file mode 100644
index 77025a44abd..00000000000
--- a/libgo/go/cmd/go/internal/semver/semver_test.go
+++ /dev/null
@@ -1,183 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package semver
-
-import (
- "strings"
- "testing"
-)
-
-var tests = []struct {
- in string
- out string
-}{
- {"bad", ""},
- {"v1-alpha.beta.gamma", ""},
- {"v1-pre", ""},
- {"v1+meta", ""},
- {"v1-pre+meta", ""},
- {"v1.2-pre", ""},
- {"v1.2+meta", ""},
- {"v1.2-pre+meta", ""},
- {"v1.0.0-alpha", "v1.0.0-alpha"},
- {"v1.0.0-alpha.1", "v1.0.0-alpha.1"},
- {"v1.0.0-alpha.beta", "v1.0.0-alpha.beta"},
- {"v1.0.0-beta", "v1.0.0-beta"},
- {"v1.0.0-beta.2", "v1.0.0-beta.2"},
- {"v1.0.0-beta.11", "v1.0.0-beta.11"},
- {"v1.0.0-rc.1", "v1.0.0-rc.1"},
- {"v1", "v1.0.0"},
- {"v1.0", "v1.0.0"},
- {"v1.0.0", "v1.0.0"},
- {"v1.2", "v1.2.0"},
- {"v1.2.0", "v1.2.0"},
- {"v1.2.3-456", "v1.2.3-456"},
- {"v1.2.3-456.789", "v1.2.3-456.789"},
- {"v1.2.3-456-789", "v1.2.3-456-789"},
- {"v1.2.3-456a", "v1.2.3-456a"},
- {"v1.2.3-pre", "v1.2.3-pre"},
- {"v1.2.3-pre+meta", "v1.2.3-pre"},
- {"v1.2.3-pre.1", "v1.2.3-pre.1"},
- {"v1.2.3-zzz", "v1.2.3-zzz"},
- {"v1.2.3", "v1.2.3"},
- {"v1.2.3+meta", "v1.2.3"},
- {"v1.2.3+meta-pre", "v1.2.3"},
- {"v1.2.3+meta-pre.sha.256a", "v1.2.3"},
-}
-
-func TestIsValid(t *testing.T) {
- for _, tt := range tests {
- ok := IsValid(tt.in)
- if ok != (tt.out != "") {
- t.Errorf("IsValid(%q) = %v, want %v", tt.in, ok, !ok)
- }
- }
-}
-
-func TestCanonical(t *testing.T) {
- for _, tt := range tests {
- out := Canonical(tt.in)
- if out != tt.out {
- t.Errorf("Canonical(%q) = %q, want %q", tt.in, out, tt.out)
- }
- }
-}
-
-func TestMajor(t *testing.T) {
- for _, tt := range tests {
- out := Major(tt.in)
- want := ""
- if i := strings.Index(tt.out, "."); i >= 0 {
- want = tt.out[:i]
- }
- if out != want {
- t.Errorf("Major(%q) = %q, want %q", tt.in, out, want)
- }
- }
-}
-
-func TestMajorMinor(t *testing.T) {
- for _, tt := range tests {
- out := MajorMinor(tt.in)
- var want string
- if tt.out != "" {
- want = tt.in
- if i := strings.Index(want, "+"); i >= 0 {
- want = want[:i]
- }
- if i := strings.Index(want, "-"); i >= 0 {
- want = want[:i]
- }
- switch strings.Count(want, ".") {
- case 0:
- want += ".0"
- case 1:
- // ok
- case 2:
- want = want[:strings.LastIndex(want, ".")]
- }
- }
- if out != want {
- t.Errorf("MajorMinor(%q) = %q, want %q", tt.in, out, want)
- }
- }
-}
-
-func TestPrerelease(t *testing.T) {
- for _, tt := range tests {
- pre := Prerelease(tt.in)
- var want string
- if tt.out != "" {
- if i := strings.Index(tt.out, "-"); i >= 0 {
- want = tt.out[i:]
- }
- }
- if pre != want {
- t.Errorf("Prerelease(%q) = %q, want %q", tt.in, pre, want)
- }
- }
-}
-
-func TestBuild(t *testing.T) {
- for _, tt := range tests {
- build := Build(tt.in)
- var want string
- if tt.out != "" {
- if i := strings.Index(tt.in, "+"); i >= 0 {
- want = tt.in[i:]
- }
- }
- if build != want {
- t.Errorf("Build(%q) = %q, want %q", tt.in, build, want)
- }
- }
-}
-
-func TestCompare(t *testing.T) {
- for i, ti := range tests {
- for j, tj := range tests {
- cmp := Compare(ti.in, tj.in)
- var want int
- if ti.out == tj.out {
- want = 0
- } else if i < j {
- want = -1
- } else {
- want = +1
- }
- if cmp != want {
- t.Errorf("Compare(%q, %q) = %d, want %d", ti.in, tj.in, cmp, want)
- }
- }
- }
-}
-
-func TestMax(t *testing.T) {
- for i, ti := range tests {
- for j, tj := range tests {
- max := Max(ti.in, tj.in)
- want := Canonical(ti.in)
- if i < j {
- want = Canonical(tj.in)
- }
- if max != want {
- t.Errorf("Max(%q, %q) = %q, want %q", ti.in, tj.in, max, want)
- }
- }
- }
-}
-
-var (
- v1 = "v1.0.0+metadata-dash"
- v2 = "v1.0.0+metadata-dash1"
-)
-
-func BenchmarkCompare(b *testing.B) {
- for i := 0; i < b.N; i++ {
- if Compare(v1, v2) != 0 {
- b.Fatalf("bad compare")
- }
- }
-}
diff --git a/libgo/go/cmd/go/internal/sumweb/cache.go b/libgo/go/cmd/go/internal/sumweb/cache.go
deleted file mode 100644
index a8117a71b78..00000000000
--- a/libgo/go/cmd/go/internal/sumweb/cache.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Parallel cache.
-// This file is copied from cmd/go/internal/par.
-
-package sumweb
-
-import (
- "sync"
- "sync/atomic"
-)
-
-// parCache runs an action once per key and caches the result.
-type parCache struct {
- m sync.Map
-}
-
-type cacheEntry struct {
- done uint32
- mu sync.Mutex
- result interface{}
-}
-
-// Do calls the function f if and only if Do is being called for the first time with this key.
-// No call to Do with a given key returns until the one call to f returns.
-// Do returns the value returned by the one call to f.
-func (c *parCache) Do(key interface{}, f func() interface{}) interface{} {
- entryIface, ok := c.m.Load(key)
- if !ok {
- entryIface, _ = c.m.LoadOrStore(key, new(cacheEntry))
- }
- e := entryIface.(*cacheEntry)
- if atomic.LoadUint32(&e.done) == 0 {
- e.mu.Lock()
- if atomic.LoadUint32(&e.done) == 0 {
- e.result = f()
- atomic.StoreUint32(&e.done, 1)
- }
- e.mu.Unlock()
- }
- return e.result
-}
-
-// Get returns the cached result associated with key.
-// It returns nil if there is no such result.
-// If the result for key is being computed, Get does not wait for the computation to finish.
-func (c *parCache) Get(key interface{}) interface{} {
- entryIface, ok := c.m.Load(key)
- if !ok {
- return nil
- }
- e := entryIface.(*cacheEntry)
- if atomic.LoadUint32(&e.done) == 0 {
- return nil
- }
- return e.result
-}
diff --git a/libgo/go/cmd/go/internal/sumweb/client.go b/libgo/go/cmd/go/internal/sumweb/client.go
deleted file mode 100644
index 6973e5ac179..00000000000
--- a/libgo/go/cmd/go/internal/sumweb/client.go
+++ /dev/null
@@ -1,619 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package sumweb
-
-import (
- "bytes"
- "errors"
- "fmt"
- "strings"
- "sync"
- "sync/atomic"
-
- "cmd/go/internal/note"
- "cmd/go/internal/str"
- "cmd/go/internal/tlog"
-)
-
-// A Client provides the external operations
-// (file caching, HTTP fetches, and so on)
-// needed to implement the HTTP client Conn.
-// The methods must be safe for concurrent use by multiple goroutines.
-type Client interface {
- // ReadRemote reads and returns the content served at the given path
- // on the remote database server. The path begins with "/lookup" or "/tile/".
- // It is the implementation's responsibility to turn that path into a full URL
- // and make the HTTP request. ReadRemote should return an error for
- // any non-200 HTTP response status.
- ReadRemote(path string) ([]byte, error)
-
- // ReadConfig reads and returns the content of the named configuration file.
- // There are only a fixed set of configuration files.
- //
- // "key" returns a file containing the verifier key for the server.
- //
- // serverName + "/latest" returns a file containing the latest known
- // signed tree from the server. It is read and written (using WriteConfig).
- // To signal that the client wishes to start with an "empty" signed tree,
- // ReadConfig can return a successful empty result (0 bytes of data).
- ReadConfig(file string) ([]byte, error)
-
- // WriteConfig updates the content of the named configuration file,
- // changing it from the old []byte to the new []byte.
- // If the old []byte does not match the stored configuration,
- // WriteConfig must return ErrWriteConflict.
- // Otherwise, WriteConfig should atomically replace old with new.
- WriteConfig(file string, old, new []byte) error
-
- // ReadCache reads and returns the content of the named cache file.
- // Any returned error will be treated as equivalent to the file not existing.
- // There can be arbitrarily many cache files, such as:
- // serverName/lookup/pkg@version
- // serverName/tile/8/1/x123/456
- ReadCache(file string) ([]byte, error)
-
- // WriteCache writes the named cache file.
- WriteCache(file string, data []byte)
-
- // Log prints the given log message (such as with log.Print)
- Log(msg string)
-
- // SecurityError prints the given security error log message.
- // The Conn returns ErrSecurity from any operation that invokes SecurityError,
- // but the return value is mainly for testing. In a real program,
- // SecurityError should typically print the message and call log.Fatal or os.Exit.
- SecurityError(msg string)
-}
-
-// ErrWriteConflict signals a write conflict during Client.WriteConfig.
-var ErrWriteConflict = errors.New("write conflict")
-
-// ErrSecurity is returned by Conn operations that invoke Client.SecurityError.
-var ErrSecurity = errors.New("security error: misbehaving server")
-
-// A Conn is a client connection to a go.sum database.
-// All the methods are safe for simultaneous use by multiple goroutines.
-type Conn struct {
- client Client // client-provided external world
-
- didLookup uint32
-
- // one-time initialized data
- initOnce sync.Once
- initErr error // init error, if any
- name string // name of accepted verifier
- verifiers note.Verifiers // accepted verifiers (just one, but Verifiers for note.Open)
- tileReader tileReader
- tileHeight int
- nosumdb string
-
- record parCache // cache of record lookup, keyed by path@vers
- tileCache parCache // cache of c.readTile, keyed by tile
-
- latestMu sync.Mutex
- latest tlog.Tree // latest known tree head
- latestMsg []byte // encoded signed note for latest
-
- tileSavedMu sync.Mutex
- tileSaved map[tlog.Tile]bool // which tiles have been saved using c.client.WriteCache already
-}
-
-// NewConn returns a new Conn using the given Client.
-func NewConn(client Client) *Conn {
- return &Conn{
- client: client,
- }
-}
-
-// init initiailzes the conn (if not already initialized)
-// and returns any initialization error.
-func (c *Conn) init() error {
- c.initOnce.Do(c.initWork)
- return c.initErr
-}
-
-// initWork does the actual initialization work.
-func (c *Conn) initWork() {
- defer func() {
- if c.initErr != nil {
- c.initErr = fmt.Errorf("initializing sumweb.Conn: %v", c.initErr)
- }
- }()
-
- c.tileReader.c = c
- if c.tileHeight == 0 {
- c.tileHeight = 8
- }
- c.tileSaved = make(map[tlog.Tile]bool)
-
- vkey, err := c.client.ReadConfig("key")
- if err != nil {
- c.initErr = err
- return
- }
- verifier, err := note.NewVerifier(strings.TrimSpace(string(vkey)))
- if err != nil {
- c.initErr = err
- return
- }
- c.verifiers = note.VerifierList(verifier)
- c.name = verifier.Name()
-
- data, err := c.client.ReadConfig(c.name + "/latest")
- if err != nil {
- c.initErr = err
- return
- }
- if err := c.mergeLatest(data); err != nil {
- c.initErr = err
- return
- }
-}
-
-// SetTileHeight sets the tile height for the Conn.
-// Any call to SetTileHeight must happen before the first call to Lookup.
-// If SetTileHeight is not called, the Conn defaults to tile height 8.
-func (c *Conn) SetTileHeight(height int) {
- if atomic.LoadUint32(&c.didLookup) != 0 {
- panic("SetTileHeight used after Lookup")
- }
- if c.tileHeight != 0 {
- panic("multiple calls to SetTileHeight")
- }
- c.tileHeight = height
-}
-
-// SetGONOSUMDB sets the list of comma-separated GONOSUMDB patterns for the Conn.
-// For any module path matching one of the patterns,
-// Lookup will return ErrGONOSUMDB.
-// Any call to SetGONOSUMDB must happen before the first call to Lookup.
-func (c *Conn) SetGONOSUMDB(list string) {
- if atomic.LoadUint32(&c.didLookup) != 0 {
- panic("SetGONOSUMDB used after Lookup")
- }
- if c.nosumdb != "" {
- panic("multiple calls to SetGONOSUMDB")
- }
- c.nosumdb = list
-}
-
-// ErrGONOSUMDB is returned by Lookup for paths that match
-// a pattern listed in the GONOSUMDB list (set by SetGONOSUMDB,
-// usually from the environment variable).
-var ErrGONOSUMDB = errors.New("skipped (listed in GONOSUMDB)")
-
-func (c *Conn) skip(target string) bool {
- return str.GlobsMatchPath(c.nosumdb, target)
-}
-
-// Lookup returns the go.sum lines for the given module path and version.
-// The version may end in a /go.mod suffix, in which case Lookup returns
-// the go.sum lines for the module's go.mod-only hash.
-func (c *Conn) Lookup(path, vers string) (lines []string, err error) {
- atomic.StoreUint32(&c.didLookup, 1)
-
- if c.skip(path) {
- return nil, ErrGONOSUMDB
- }
-
- defer func() {
- if err != nil {
- err = fmt.Errorf("%s@%s: %v", path, vers, err)
- }
- }()
-
- if err := c.init(); err != nil {
- return nil, err
- }
-
- // Prepare encoded cache filename / URL.
- epath, err := encodePath(path)
- if err != nil {
- return nil, err
- }
- evers, err := encodeVersion(strings.TrimSuffix(vers, "/go.mod"))
- if err != nil {
- return nil, err
- }
- file := c.name + "/lookup/" + epath + "@" + evers
- remotePath := "/lookup/" + epath + "@" + evers
-
- // Fetch the data.
- // The lookupCache avoids redundant ReadCache/GetURL operations
- // (especially since go.sum lines tend to come in pairs for a given
- // path and version) and also avoids having multiple of the same
- // request in flight at once.
- type cached struct {
- data []byte
- err error
- }
- result := c.record.Do(file, func() interface{} {
- // Try the on-disk cache, or else get from web.
- writeCache := false
- data, err := c.client.ReadCache(file)
- if err != nil {
- data, err = c.client.ReadRemote(remotePath)
- if err != nil {
- return cached{nil, err}
- }
- writeCache = true
- }
-
- // Validate the record before using it for anything.
- id, text, treeMsg, err := tlog.ParseRecord(data)
- if err != nil {
- return cached{nil, err}
- }
- if err := c.mergeLatest(treeMsg); err != nil {
- return cached{nil, err}
- }
- if err := c.checkRecord(id, text); err != nil {
- return cached{nil, err}
- }
-
- // Now that we've validated the record,
- // save it to the on-disk cache (unless that's where it came from).
- if writeCache {
- c.client.WriteCache(file, data)
- }
-
- return cached{data, nil}
- }).(cached)
- if result.err != nil {
- return nil, result.err
- }
-
- // Extract the lines for the specific version we want
- // (with or without /go.mod).
- prefix := path + " " + vers + " "
- var hashes []string
- for _, line := range strings.Split(string(result.data), "\n") {
- if strings.HasPrefix(line, prefix) {
- hashes = append(hashes, line)
- }
- }
- return hashes, nil
-}
-
-// mergeLatest merges the tree head in msg
-// with the Conn's current latest tree head,
-// ensuring the result is a consistent timeline.
-// If the result is inconsistent, mergeLatest calls c.client.SecurityError
-// with a detailed security error message and then
-// (only if c.client.SecurityError does not exit the program) returns ErrSecurity.
-// If the Conn's current latest tree head moves forward,
-// mergeLatest updates the underlying configuration file as well,
-// taking care to merge any independent updates to that configuration.
-func (c *Conn) mergeLatest(msg []byte) error {
- // Merge msg into our in-memory copy of the latest tree head.
- when, err := c.mergeLatestMem(msg)
- if err != nil {
- return err
- }
- if when != msgFuture {
- // msg matched our present or was in the past.
- // No change to our present, so no update of config file.
- return nil
- }
-
- // Flush our extended timeline back out to the configuration file.
- // If the configuration file has been updated in the interim,
- // we need to merge any updates made there as well.
- // Note that writeConfig is an atomic compare-and-swap.
- for {
- msg, err := c.client.ReadConfig(c.name + "/latest")
- if err != nil {
- return err
- }
- when, err := c.mergeLatestMem(msg)
- if err != nil {
- return err
- }
- if when != msgPast {
- // msg matched our present or was from the future,
- // and now our in-memory copy matches.
- return nil
- }
-
- // msg (== config) is in the past, so we need to update it.
- c.latestMu.Lock()
- latestMsg := c.latestMsg
- c.latestMu.Unlock()
- if err := c.client.WriteConfig(c.name+"/latest", msg, latestMsg); err != ErrWriteConflict {
- // Success or a non-write-conflict error.
- return err
- }
- }
-}
-
-const (
- msgPast = 1 + iota
- msgNow
- msgFuture
-)
-
-// mergeLatestMem is like mergeLatest but is only concerned with
-// updating the in-memory copy of the latest tree head (c.latest)
-// not the configuration file.
-// The when result explains when msg happened relative to our
-// previous idea of c.latest:
-// msgPast means msg was from before c.latest,
-// msgNow means msg was exactly c.latest, and
-// msgFuture means msg was from after c.latest, which has now been updated.
-func (c *Conn) mergeLatestMem(msg []byte) (when int, err error) {
- if len(msg) == 0 {
- // Accept empty msg as the unsigned, empty timeline.
- c.latestMu.Lock()
- latest := c.latest
- c.latestMu.Unlock()
- if latest.N == 0 {
- return msgNow, nil
- }
- return msgPast, nil
- }
-
- note, err := note.Open(msg, c.verifiers)
- if err != nil {
- return 0, fmt.Errorf("reading tree note: %v\nnote:\n%s", err, msg)
- }
- tree, err := tlog.ParseTree([]byte(note.Text))
- if err != nil {
- return 0, fmt.Errorf("reading tree: %v\ntree:\n%s", err, note.Text)
- }
-
- // Other lookups may be calling mergeLatest with other heads,
- // so c.latest is changing underfoot. We don't want to hold the
- // c.mu lock during tile fetches, so loop trying to update c.latest.
- c.latestMu.Lock()
- latest := c.latest
- latestMsg := c.latestMsg
- c.latestMu.Unlock()
-
- for {
- // If the tree head looks old, check that it is on our timeline.
- if tree.N <= latest.N {
- if err := c.checkTrees(tree, msg, latest, latestMsg); err != nil {
- return 0, err
- }
- if tree.N < latest.N {
- return msgPast, nil
- }
- return msgNow, nil
- }
-
- // The tree head looks new. Check that we are on its timeline and try to move our timeline forward.
- if err := c.checkTrees(latest, latestMsg, tree, msg); err != nil {
- return 0, err
- }
-
- // Install our msg if possible.
- // Otherwise we will go around again.
- c.latestMu.Lock()
- installed := false
- if c.latest == latest {
- installed = true
- c.latest = tree
- c.latestMsg = msg
- } else {
- latest = c.latest
- latestMsg = c.latestMsg
- }
- c.latestMu.Unlock()
-
- if installed {
- return msgFuture, nil
- }
- }
-}
-
-// checkTrees checks that older (from olderNote) is contained in newer (from newerNote).
-// If an error occurs, such as malformed data or a network problem, checkTrees returns that error.
-// If on the other hand checkTrees finds evidence of misbehavior, it prepares a detailed
-// message and calls log.Fatal.
-func (c *Conn) checkTrees(older tlog.Tree, olderNote []byte, newer tlog.Tree, newerNote []byte) error {
- thr := tlog.TileHashReader(newer, &c.tileReader)
- h, err := tlog.TreeHash(older.N, thr)
- if err != nil {
- if older.N == newer.N {
- return fmt.Errorf("checking tree#%d: %v", older.N, err)
- }
- return fmt.Errorf("checking tree#%d against tree#%d: %v", older.N, newer.N, err)
- }
- if h == older.Hash {
- return nil
- }
-
- // Detected a fork in the tree timeline.
- // Start by reporting the inconsistent signed tree notes.
- var buf bytes.Buffer
- fmt.Fprintf(&buf, "SECURITY ERROR\n")
- fmt.Fprintf(&buf, "go.sum database server misbehavior detected!\n\n")
- indent := func(b []byte) []byte {
- return bytes.Replace(b, []byte("\n"), []byte("\n\t"), -1)
- }
- fmt.Fprintf(&buf, "old database:\n\t%s\n", indent(olderNote))
- fmt.Fprintf(&buf, "new database:\n\t%s\n", indent(newerNote))
-
- // The notes alone are not enough to prove the inconsistency.
- // We also need to show that the newer note's tree hash for older.N
- // does not match older.Hash. The consumer of this report could
- // of course consult the server to try to verify the inconsistency,
- // but we are holding all the bits we need to prove it right now,
- // so we might as well print them and make the report not depend
- // on the continued availability of the misbehaving server.
- // Preparing this data only reuses the tiled hashes needed for
- // tlog.TreeHash(older.N, thr) above, so assuming thr is caching tiles,
- // there are no new access to the server here, and these operations cannot fail.
- fmt.Fprintf(&buf, "proof of misbehavior:\n\t%v", h)
- if p, err := tlog.ProveTree(newer.N, older.N, thr); err != nil {
- fmt.Fprintf(&buf, "\tinternal error: %v\n", err)
- } else if err := tlog.CheckTree(p, newer.N, newer.Hash, older.N, h); err != nil {
- fmt.Fprintf(&buf, "\tinternal error: generated inconsistent proof\n")
- } else {
- for _, h := range p {
- fmt.Fprintf(&buf, "\n\t%v", h)
- }
- }
- c.client.SecurityError(buf.String())
- return ErrSecurity
-}
-
-// checkRecord checks that record #id's hash matches data.
-func (c *Conn) checkRecord(id int64, data []byte) error {
- c.latestMu.Lock()
- latest := c.latest
- c.latestMu.Unlock()
-
- if id >= latest.N {
- return fmt.Errorf("cannot validate record %d in tree of size %d", id, latest.N)
- }
- hashes, err := tlog.TileHashReader(latest, &c.tileReader).ReadHashes([]int64{tlog.StoredHashIndex(0, id)})
- if err != nil {
- return err
- }
- if hashes[0] == tlog.RecordHash(data) {
- return nil
- }
- return fmt.Errorf("cannot authenticate record data in server response")
-}
-
-// tileReader is a *Conn wrapper that implements tlog.TileReader.
-// The separate type avoids exposing the ReadTiles and SaveTiles
-// methods on Conn itself.
-type tileReader struct {
- c *Conn
-}
-
-func (r *tileReader) Height() int {
- return r.c.tileHeight
-}
-
-// ReadTiles reads and returns the requested tiles,
-// either from the on-disk cache or the server.
-func (r *tileReader) ReadTiles(tiles []tlog.Tile) ([][]byte, error) {
- // Read all the tiles in parallel.
- data := make([][]byte, len(tiles))
- errs := make([]error, len(tiles))
- var wg sync.WaitGroup
- for i, tile := range tiles {
- wg.Add(1)
- go func(i int, tile tlog.Tile) {
- defer wg.Done()
- data[i], errs[i] = r.c.readTile(tile)
- }(i, tile)
- }
- wg.Wait()
-
- for _, err := range errs {
- if err != nil {
- return nil, err
- }
- }
-
- return data, nil
-}
-
-// tileCacheKey returns the cache key for the tile.
-func (c *Conn) tileCacheKey(tile tlog.Tile) string {
- return c.name + "/" + tile.Path()
-}
-
-// tileRemotePath returns the remote path for the tile.
-func (c *Conn) tileRemotePath(tile tlog.Tile) string {
- return "/" + tile.Path()
-}
-
-// readTile reads a single tile, either from the on-disk cache or the server.
-func (c *Conn) readTile(tile tlog.Tile) ([]byte, error) {
- type cached struct {
- data []byte
- err error
- }
-
- result := c.tileCache.Do(tile, func() interface{} {
- // Try the requested tile in on-disk cache.
- data, err := c.client.ReadCache(c.tileCacheKey(tile))
- if err == nil {
- c.markTileSaved(tile)
- return cached{data, nil}
- }
-
- // Try the full tile in on-disk cache (if requested tile not already full).
- // We only save authenticated tiles to the on-disk cache,
- // so the recreated prefix is equally authenticated.
- full := tile
- full.W = 1 << tile.H
- if tile != full {
- data, err := c.client.ReadCache(c.tileCacheKey(full))
- if err == nil {
- c.markTileSaved(tile) // don't save tile later; we already have full
- return cached{data[:len(data)/full.W*tile.W], nil}
- }
- }
-
- // Try requested tile from server.
- data, err = c.client.ReadRemote(c.tileRemotePath(tile))
- if err == nil {
- return cached{data, nil}
- }
-
- // Try full tile on server.
- // If the partial tile does not exist, it should be because
- // the tile has been completed and only the complete one
- // is available.
- if tile != full {
- data, err := c.client.ReadRemote(c.tileRemotePath(full))
- if err == nil {
- // Note: We could save the full tile in the on-disk cache here,
- // but we don't know if it is valid yet, and we will only find out
- // about the partial data, not the full data. So let SaveTiles
- // save the partial tile, and we'll just refetch the full tile later
- // once we can validate more (or all) of it.
- return cached{data[:len(data)/full.W*tile.W], nil}
- }
- }
-
- // Nothing worked.
- // Return the error from the server fetch for the requested (not full) tile.
- return cached{nil, err}
- }).(cached)
-
- return result.data, result.err
-}
-
-// markTileSaved records that tile is already present in the on-disk cache,
-// so that a future SaveTiles for that tile can be ignored.
-func (c *Conn) markTileSaved(tile tlog.Tile) {
- c.tileSavedMu.Lock()
- c.tileSaved[tile] = true
- c.tileSavedMu.Unlock()
-}
-
-// SaveTiles saves the now validated tiles.
-func (r *tileReader) SaveTiles(tiles []tlog.Tile, data [][]byte) {
- c := r.c
-
- // Determine which tiles need saving.
- // (Tiles that came from the cache need not be saved back.)
- save := make([]bool, len(tiles))
- c.tileSavedMu.Lock()
- for i, tile := range tiles {
- if !c.tileSaved[tile] {
- save[i] = true
- c.tileSaved[tile] = true
- }
- }
- c.tileSavedMu.Unlock()
-
- for i, tile := range tiles {
- if save[i] {
- // If WriteCache fails here (out of disk space? i/o error?),
- // c.tileSaved[tile] is still true and we will not try to write it again.
- // Next time we run maybe we'll redownload it again and be
- // more successful.
- c.client.WriteCache(c.name+"/"+tile.Path(), data[i])
- }
- }
-}
diff --git a/libgo/go/cmd/go/internal/sumweb/client_test.go b/libgo/go/cmd/go/internal/sumweb/client_test.go
deleted file mode 100644
index 83a182adc55..00000000000
--- a/libgo/go/cmd/go/internal/sumweb/client_test.go
+++ /dev/null
@@ -1,460 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package sumweb
-
-import (
- "bytes"
- "fmt"
- "strings"
- "sync"
- "testing"
-
- "cmd/go/internal/note"
- "cmd/go/internal/tlog"
-)
-
-const (
- testName = "localhost.localdev/sumdb"
- testVerifierKey = "localhost.localdev/sumdb+00000c67+AcTrnkbUA+TU4heY3hkjiSES/DSQniBqIeQ/YppAUtK6"
- testSignerKey = "PRIVATE+KEY+localhost.localdev/sumdb+00000c67+AXu6+oaVaOYuQOFrf1V59JK1owcFlJcHwwXHDfDGxSPk"
-)
-
-func TestConnLookup(t *testing.T) {
- tc := newTestClient(t)
- tc.mustHaveLatest(1)
-
- // Basic lookup.
- tc.mustLookup("rsc.io/sampler", "v1.3.0", "rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=")
- tc.mustHaveLatest(3)
-
- // Everything should now be cached, both for the original package and its /go.mod.
- tc.getOK = false
- tc.mustLookup("rsc.io/sampler", "v1.3.0", "rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=")
- tc.mustLookup("rsc.io/sampler", "v1.3.0/go.mod", "rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=")
- tc.mustHaveLatest(3)
- tc.getOK = true
- tc.getTileOK = false // the cache has what we need
-
- // Lookup with multiple returned lines.
- tc.mustLookup("rsc.io/quote", "v1.5.2", "rsc.io/quote v1.5.2 h1:w5fcysjrx7yqtD/aO+QwRjYZOKnaM9Uh2b40tElTs3Y=\nrsc.io/quote v1.5.2 h2:xyzzy")
- tc.mustHaveLatest(3)
-
- // Lookup with need for !-encoding.
- // rsc.io/Quote is the only record written after rsc.io/samper,
- // so it is the only one that should need more tiles.
- tc.getTileOK = true
- tc.mustLookup("rsc.io/Quote", "v1.5.2", "rsc.io/Quote v1.5.2 h1:uppercase!=")
- tc.mustHaveLatest(4)
-}
-
-func TestConnBadTiles(t *testing.T) {
- tc := newTestClient(t)
-
- flipBits := func() {
- for url, data := range tc.remote {
- if strings.Contains(url, "/tile/") {
- for i := range data {
- data[i] ^= 0x80
- }
- }
- }
- }
-
- // Bad tiles in initial download.
- tc.mustHaveLatest(1)
- flipBits()
- _, err := tc.conn.Lookup("rsc.io/sampler", "v1.3.0")
- tc.mustError(err, "rsc.io/sampler@v1.3.0: initializing sumweb.Conn: checking tree#1: downloaded inconsistent tile")
- flipBits()
- tc.newConn()
- tc.mustLookup("rsc.io/sampler", "v1.3.0", "rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=")
-
- // Bad tiles after initial download.
- flipBits()
- _, err = tc.conn.Lookup("rsc.io/Quote", "v1.5.2")
- tc.mustError(err, "rsc.io/Quote@v1.5.2: checking tree#3 against tree#4: downloaded inconsistent tile")
- flipBits()
- tc.newConn()
- tc.mustLookup("rsc.io/Quote", "v1.5.2", "rsc.io/Quote v1.5.2 h1:uppercase!=")
-
- // Bad starting tree hash looks like bad tiles.
- tc.newConn()
- text := tlog.FormatTree(tlog.Tree{N: 1, Hash: tlog.Hash{}})
- data, err := note.Sign(&note.Note{Text: string(text)}, tc.signer)
- if err != nil {
- tc.t.Fatal(err)
- }
- tc.config[testName+"/latest"] = data
- _, err = tc.conn.Lookup("rsc.io/sampler", "v1.3.0")
- tc.mustError(err, "rsc.io/sampler@v1.3.0: initializing sumweb.Conn: checking tree#1: downloaded inconsistent tile")
-}
-
-func TestConnFork(t *testing.T) {
- tc := newTestClient(t)
- tc2 := tc.fork()
-
- tc.addRecord("rsc.io/pkg1@v1.5.2", `rsc.io/pkg1 v1.5.2 h1:hash!=
-`)
- tc.addRecord("rsc.io/pkg1@v1.5.4", `rsc.io/pkg1 v1.5.4 h1:hash!=
-`)
- tc.mustLookup("rsc.io/pkg1", "v1.5.2", "rsc.io/pkg1 v1.5.2 h1:hash!=")
-
- tc2.addRecord("rsc.io/pkg1@v1.5.3", `rsc.io/pkg1 v1.5.3 h1:hash!=
-`)
- tc2.addRecord("rsc.io/pkg1@v1.5.4", `rsc.io/pkg1 v1.5.4 h1:hash!=
-`)
- tc2.mustLookup("rsc.io/pkg1", "v1.5.4", "rsc.io/pkg1 v1.5.4 h1:hash!=")
-
- key := "/lookup/rsc.io/pkg1@v1.5.2"
- tc2.remote[key] = tc.remote[key]
- _, err := tc2.conn.Lookup("rsc.io/pkg1", "v1.5.2")
- tc2.mustError(err, ErrSecurity.Error())
-
- /*
- SECURITY ERROR
- go.sum database server misbehavior detected!
-
- old database:
- go.sum database tree!
- 5
- nWzN20+pwMt62p7jbv1/NlN95ePTlHijabv5zO/s36w=
-
- — localhost.localdev/sumdb AAAMZ5/2FVAdMH58kmnz/0h299pwyskEbzDzoa2/YaPdhvLya4YWDFQQxu2TQb5GpwAH4NdWnTwuhILafisyf3CNbgg=
-
- new database:
- go.sum database tree
- 6
- wc4SkQt52o5W2nQ8To2ARs+mWuUJjss+sdleoiqxMmM=
-
- — localhost.localdev/sumdb AAAMZ6oRNswlEZ6ZZhxrCvgl1MBy+nusq4JU+TG6Fe2NihWLqOzb+y2c2kzRLoCr4tvw9o36ucQEnhc20e4nA4Qc/wc=
-
- proof of misbehavior:
- T7i+H/8ER4nXOiw4Bj0koZOkGjkxoNvlI34GpvhHhQg=
- Nsuejv72de9hYNM5bqFv8rv3gm3zJQwv/DT/WNbLDLA=
- mOmqqZ1aI/lzS94oq/JSbj7pD8Rv9S+xDyi12BtVSHo=
- /7Aw5jVSMM9sFjQhaMg+iiDYPMk6decH7QLOGrL9Lx0=
- */
-
- wants := []string{
- "SECURITY ERROR",
- "go.sum database server misbehavior detected!",
- "old database:\n\tgo.sum database tree\n\t5\n",
- "— localhost.localdev/sumdb AAAMZ5/2FVAd",
- "new database:\n\tgo.sum database tree\n\t6\n",
- "— localhost.localdev/sumdb AAAMZ6oRNswl",
- "proof of misbehavior:\n\tT7i+H/8ER4nXOiw4Bj0k",
- }
- text := tc2.security.String()
- for _, want := range wants {
- if !strings.Contains(text, want) {
- t.Fatalf("cannot find %q in security text:\n%s", want, text)
- }
- }
-}
-
-func TestConnGONOSUMDB(t *testing.T) {
- tc := newTestClient(t)
- tc.conn.SetGONOSUMDB("p,*/q")
- tc.conn.Lookup("rsc.io/sampler", "v1.3.0") // initialize before we turn off network
- tc.getOK = false
-
- ok := []string{
- "abc",
- "a/p",
- "pq",
- "q",
- "n/o/p/q",
- }
- skip := []string{
- "p",
- "p/x",
- "x/q",
- "x/q/z",
- }
-
- for _, path := range ok {
- _, err := tc.conn.Lookup(path, "v1.0.0")
- if err == ErrGONOSUMDB {
- t.Errorf("Lookup(%q): ErrGONOSUMDB, wanted failed actual lookup", path)
- }
- }
- for _, path := range skip {
- _, err := tc.conn.Lookup(path, "v1.0.0")
- if err != ErrGONOSUMDB {
- t.Errorf("Lookup(%q): %v, wanted ErrGONOSUMDB", path, err)
- }
- }
-}
-
-// A testClient is a self-contained client-side testing environment.
-type testClient struct {
- t *testing.T // active test
- conn *Conn // conn being tested
- tileHeight int // tile height to use (default 2)
- getOK bool // should tc.GetURL succeed?
- getTileOK bool // should tc.GetURL of tiles succeed?
- treeSize int64
- hashes []tlog.Hash
- remote map[string][]byte
- signer note.Signer
-
- // mu protects config, cache, log, security
- // during concurrent use of the exported methods
- // by the conn itself (testClient is the Conn's Client,
- // and the Client methods can both read and write these fields).
- // Unexported methods invoked directly by the test
- // (for example, addRecord) need not hold the mutex:
- // for proper test execution those methods should only
- // be called when the Conn is idle and not using its Client.
- // Not holding the mutex in those methods ensures
- // that if a mistake is made, go test -race will report it.
- // (Holding the mutex would eliminate the race report but
- // not the underlying problem.)
- // Similarly, the get map is not protected by the mutex,
- // because the Client methods only read it.
- mu sync.Mutex // prot
- config map[string][]byte
- cache map[string][]byte
- security bytes.Buffer
-}
-
-// newTestClient returns a new testClient that will call t.Fatal on error
-// and has a few records already available on the remote server.
-func newTestClient(t *testing.T) *testClient {
- tc := &testClient{
- t: t,
- tileHeight: 2,
- getOK: true,
- getTileOK: true,
- config: make(map[string][]byte),
- cache: make(map[string][]byte),
- remote: make(map[string][]byte),
- }
-
- tc.config["key"] = []byte(testVerifierKey + "\n")
- var err error
- tc.signer, err = note.NewSigner(testSignerKey)
- if err != nil {
- t.Fatal(err)
- }
-
- tc.newConn()
-
- tc.addRecord("rsc.io/quote@v1.5.2", `rsc.io/quote v1.5.2 h1:w5fcysjrx7yqtD/aO+QwRjYZOKnaM9Uh2b40tElTs3Y=
-rsc.io/quote v1.5.2/go.mod h1:LzX7hefJvL54yjefDEDHNONDjII0t9xZLPXsUe+TKr0=
-rsc.io/quote v1.5.2 h2:xyzzy
-`)
-
- tc.addRecord("golang.org/x/text@v0.0.0-20170915032832-14c0d48ead0c", `golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c h1:qgOY6WgZOaTkIIMiVjBQcw93ERBE4m30iBm00nkL0i8=
-golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-`)
- tc.addRecord("rsc.io/sampler@v1.3.0", `rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=
-rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
-`)
- tc.config[testName+"/latest"] = tc.signTree(1)
-
- tc.addRecord("rsc.io/!quote@v1.5.2", `rsc.io/Quote v1.5.2 h1:uppercase!=
-`)
- return tc
-}
-
-// newConn resets the Conn associated with tc.
-// This clears any in-memory cache from the Conn
-// but not tc's on-disk cache.
-func (tc *testClient) newConn() {
- tc.conn = NewConn(tc)
- tc.conn.SetTileHeight(tc.tileHeight)
-}
-
-// mustLookup does a lookup for path@vers and checks that the lines that come back match want.
-func (tc *testClient) mustLookup(path, vers, want string) {
- tc.t.Helper()
- lines, err := tc.conn.Lookup(path, vers)
- if err != nil {
- tc.t.Fatal(err)
- }
- if strings.Join(lines, "\n") != want {
- tc.t.Fatalf("Lookup(%q, %q):\n\t%s\nwant:\n\t%s", path, vers, strings.Join(lines, "\n\t"), strings.Replace(want, "\n", "\n\t", -1))
- }
-}
-
-// mustHaveLatest checks that the on-disk configuration
-// for latest is a tree of size n.
-func (tc *testClient) mustHaveLatest(n int64) {
- tc.t.Helper()
-
- latest := tc.config[testName+"/latest"]
- lines := strings.Split(string(latest), "\n")
- if len(lines) < 2 || lines[1] != fmt.Sprint(n) {
- tc.t.Fatalf("/latest should have tree %d, but has:\n%s", n, latest)
- }
-}
-
-// mustError checks that err's error string contains the text.
-func (tc *testClient) mustError(err error, text string) {
- tc.t.Helper()
- if err == nil || !strings.Contains(err.Error(), text) {
- tc.t.Fatalf("err = %v, want %q", err, text)
- }
-}
-
-// fork returns a copy of tc.
-// Changes made to the new copy or to tc are not reflected in the other.
-func (tc *testClient) fork() *testClient {
- tc2 := &testClient{
- t: tc.t,
- getOK: tc.getOK,
- getTileOK: tc.getTileOK,
- tileHeight: tc.tileHeight,
- treeSize: tc.treeSize,
- hashes: append([]tlog.Hash{}, tc.hashes...),
- signer: tc.signer,
- config: copyMap(tc.config),
- cache: copyMap(tc.cache),
- remote: copyMap(tc.remote),
- }
- tc2.newConn()
- return tc2
-}
-
-func copyMap(m map[string][]byte) map[string][]byte {
- m2 := make(map[string][]byte)
- for k, v := range m {
- m2[k] = v
- }
- return m2
-}
-
-// ReadHashes is tc's implementation of tlog.HashReader, for use with
-// tlog.TreeHash and so on.
-func (tc *testClient) ReadHashes(indexes []int64) ([]tlog.Hash, error) {
- var list []tlog.Hash
- for _, id := range indexes {
- list = append(list, tc.hashes[id])
- }
- return list, nil
-}
-
-// addRecord adds a log record using the given (!-encoded) key and data.
-func (tc *testClient) addRecord(key, data string) {
- tc.t.Helper()
-
- // Create record, add hashes to log tree.
- id := tc.treeSize
- tc.treeSize++
- rec, err := tlog.FormatRecord(id, []byte(data))
- if err != nil {
- tc.t.Fatal(err)
- }
- hashes, err := tlog.StoredHashesForRecordHash(id, tlog.RecordHash([]byte(data)), tc)
- if err != nil {
- tc.t.Fatal(err)
- }
- tc.hashes = append(tc.hashes, hashes...)
-
- // Create lookup result.
- tc.remote["/lookup/"+key] = append(rec, tc.signTree(tc.treeSize)...)
-
- // Create new tiles.
- tiles := tlog.NewTiles(tc.tileHeight, id, tc.treeSize)
- for _, tile := range tiles {
- data, err := tlog.ReadTileData(tile, tc)
- if err != nil {
- tc.t.Fatal(err)
- }
- tc.remote["/"+tile.Path()] = data
- // TODO delete old partial tiles
- }
-}
-
-// signTree returns the signed head for the tree of the given size.
-func (tc *testClient) signTree(size int64) []byte {
- h, err := tlog.TreeHash(size, tc)
- if err != nil {
- tc.t.Fatal(err)
- }
- text := tlog.FormatTree(tlog.Tree{N: size, Hash: h})
- data, err := note.Sign(&note.Note{Text: string(text)}, tc.signer)
- if err != nil {
- tc.t.Fatal(err)
- }
- return data
-}
-
-// ReadRemote is for tc's implementation of Client.
-func (tc *testClient) ReadRemote(path string) ([]byte, error) {
- // No mutex here because only the Client should be running
- // and the Client cannot change tc.get.
- if !tc.getOK {
- return nil, fmt.Errorf("disallowed remote read %s", path)
- }
- if strings.Contains(path, "/tile/") && !tc.getTileOK {
- return nil, fmt.Errorf("disallowed remote tile read %s", path)
- }
-
- data, ok := tc.remote[path]
- if !ok {
- return nil, fmt.Errorf("no remote path %s", path)
- }
- return data, nil
-}
-
-// ReadConfig is for tc's implementation of Client.
-func (tc *testClient) ReadConfig(file string) ([]byte, error) {
- tc.mu.Lock()
- defer tc.mu.Unlock()
-
- data, ok := tc.config[file]
- if !ok {
- return nil, fmt.Errorf("no config %s", file)
- }
- return data, nil
-}
-
-// WriteConfig is for tc's implementation of Client.
-func (tc *testClient) WriteConfig(file string, old, new []byte) error {
- tc.mu.Lock()
- defer tc.mu.Unlock()
-
- data := tc.config[file]
- if !bytes.Equal(old, data) {
- return ErrWriteConflict
- }
- tc.config[file] = new
- return nil
-}
-
-// ReadCache is for tc's implementation of Client.
-func (tc *testClient) ReadCache(file string) ([]byte, error) {
- tc.mu.Lock()
- defer tc.mu.Unlock()
-
- data, ok := tc.cache[file]
- if !ok {
- return nil, fmt.Errorf("no cache %s", file)
- }
- return data, nil
-}
-
-// WriteCache is for tc's implementation of Client.
-func (tc *testClient) WriteCache(file string, data []byte) {
- tc.mu.Lock()
- defer tc.mu.Unlock()
-
- tc.cache[file] = data
-}
-
-// Log is for tc's implementation of Client.
-func (tc *testClient) Log(msg string) {
- tc.t.Log(msg)
-}
-
-// SecurityError is for tc's implementation of Client.
-func (tc *testClient) SecurityError(msg string) {
- tc.mu.Lock()
- defer tc.mu.Unlock()
-
- fmt.Fprintf(&tc.security, "%s\n", strings.TrimRight(msg, "\n"))
-}
diff --git a/libgo/go/cmd/go/internal/sumweb/encode.go b/libgo/go/cmd/go/internal/sumweb/encode.go
deleted file mode 100644
index d044a84f3a8..00000000000
--- a/libgo/go/cmd/go/internal/sumweb/encode.go
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// FS-safe encoding of module paths and versions.
-// Copied from cmd/go/internal/module and unexported.
-
-package sumweb
-
-import (
- "fmt"
- "unicode/utf8"
-)
-
-// Safe encodings
-//
-// Module paths appear as substrings of file system paths
-// (in the download cache) and of web server URLs in the proxy protocol.
-// In general we cannot rely on file systems to be case-sensitive,
-// nor can we rely on web servers, since they read from file systems.
-// That is, we cannot rely on the file system to keep rsc.io/QUOTE
-// and rsc.io/quote separate. Windows and macOS don't.
-// Instead, we must never require two different casings of a file path.
-// Because we want the download cache to match the proxy protocol,
-// and because we want the proxy protocol to be possible to serve
-// from a tree of static files (which might be stored on a case-insensitive
-// file system), the proxy protocol must never require two different casings
-// of a URL path either.
-//
-// One possibility would be to make the safe encoding be the lowercase
-// hexadecimal encoding of the actual path bytes. This would avoid ever
-// needing different casings of a file path, but it would be fairly illegible
-// to most programmers when those paths appeared in the file system
-// (including in file paths in compiler errors and stack traces)
-// in web server logs, and so on. Instead, we want a safe encoding that
-// leaves most paths unaltered.
-//
-// The safe encoding is this:
-// replace every uppercase letter with an exclamation mark
-// followed by the letter's lowercase equivalent.
-//
-// For example,
-// github.com/Azure/azure-sdk-for-go -> github.com/!azure/azure-sdk-for-go.
-// github.com/GoogleCloudPlatform/cloudsql-proxy -> github.com/!google!cloud!platform/cloudsql-proxy
-// github.com/Sirupsen/logrus -> github.com/!sirupsen/logrus.
-//
-// Import paths that avoid upper-case letters are left unchanged.
-// Note that because import paths are ASCII-only and avoid various
-// problematic punctuation (like : < and >), the safe encoding is also ASCII-only
-// and avoids the same problematic punctuation.
-//
-// Import paths have never allowed exclamation marks, so there is no
-// need to define how to encode a literal !.
-//
-// Although paths are disallowed from using Unicode (see pathOK above),
-// the eventual plan is to allow Unicode letters as well, to assume that
-// file systems and URLs are Unicode-safe (storing UTF-8), and apply
-// the !-for-uppercase convention. Note however that not all runes that
-// are different but case-fold equivalent are an upper/lower pair.
-// For example, U+004B ('K'), U+006B ('k'), and U+212A ('K' for Kelvin)
-// are considered to case-fold to each other. When we do add Unicode
-// letters, we must not assume that upper/lower are the only case-equivalent pairs.
-// Perhaps the Kelvin symbol would be disallowed entirely, for example.
-// Or perhaps it would encode as "!!k", or perhaps as "(212A)".
-//
-// Also, it would be nice to allow Unicode marks as well as letters,
-// but marks include combining marks, and then we must deal not
-// only with case folding but also normalization: both U+00E9 ('é')
-// and U+0065 U+0301 ('e' followed by combining acute accent)
-// look the same on the page and are treated by some file systems
-// as the same path. If we do allow Unicode marks in paths, there
-// must be some kind of normalization to allow only one canonical
-// encoding of any character used in an import path.
-
-// encodePath returns the safe encoding of the given module path.
-// It fails if the module path is invalid.
-func encodePath(path string) (encoding string, err error) {
- return encodeString(path)
-}
-
-// encodeVersion returns the safe encoding of the given module version.
-// Versions are allowed to be in non-semver form but must be valid file names
-// and not contain exclamation marks.
-func encodeVersion(v string) (encoding string, err error) {
- return encodeString(v)
-}
-
-func encodeString(s string) (encoding string, err error) {
- haveUpper := false
- for _, r := range s {
- if r == '!' || r >= utf8.RuneSelf {
- // This should be disallowed by CheckPath, but diagnose anyway.
- // The correctness of the encoding loop below depends on it.
- return "", fmt.Errorf("internal error: inconsistency in EncodePath")
- }
- if 'A' <= r && r <= 'Z' {
- haveUpper = true
- }
- }
-
- if !haveUpper {
- return s, nil
- }
-
- var buf []byte
- for _, r := range s {
- if 'A' <= r && r <= 'Z' {
- buf = append(buf, '!', byte(r+'a'-'A'))
- } else {
- buf = append(buf, byte(r))
- }
- }
- return string(buf), nil
-}
-
-// decodePath returns the module path of the given safe encoding.
-// It fails if the encoding is invalid or encodes an invalid path.
-func decodePath(encoding string) (path string, err error) {
- path, ok := decodeString(encoding)
- if !ok {
- return "", fmt.Errorf("invalid module path encoding %q", encoding)
- }
- return path, nil
-}
-
-// decodeVersion returns the version string for the given safe encoding.
-// It fails if the encoding is invalid or encodes an invalid version.
-// Versions are allowed to be in non-semver form but must be valid file names
-// and not contain exclamation marks.
-func decodeVersion(encoding string) (v string, err error) {
- v, ok := decodeString(encoding)
- if !ok {
- return "", fmt.Errorf("invalid version encoding %q", encoding)
- }
- return v, nil
-}
-
-func decodeString(encoding string) (string, bool) {
- var buf []byte
-
- bang := false
- for _, r := range encoding {
- if r >= utf8.RuneSelf {
- return "", false
- }
- if bang {
- bang = false
- if r < 'a' || 'z' < r {
- return "", false
- }
- buf = append(buf, byte(r+'A'-'a'))
- continue
- }
- if r == '!' {
- bang = true
- continue
- }
- if 'A' <= r && r <= 'Z' {
- return "", false
- }
- buf = append(buf, byte(r))
- }
- if bang {
- return "", false
- }
- return string(buf), true
-}
diff --git a/libgo/go/cmd/go/internal/sumweb/encode_test.go b/libgo/go/cmd/go/internal/sumweb/encode_test.go
deleted file mode 100644
index 9ed5e4a9a04..00000000000
--- a/libgo/go/cmd/go/internal/sumweb/encode_test.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package sumweb
-
-import "testing"
-
-var encodeTests = []struct {
- path string
- enc string // empty means same as path
-}{
- {path: "ascii.com/abcdefghijklmnopqrstuvwxyz.-+/~_0123456789"},
- {path: "github.com/GoogleCloudPlatform/omega", enc: "github.com/!google!cloud!platform/omega"},
-}
-
-func TestEncodePath(t *testing.T) {
- // Check encodings.
- for _, tt := range encodeTests {
- enc, err := encodePath(tt.path)
- if err != nil {
- t.Errorf("encodePath(%q): unexpected error: %v", tt.path, err)
- continue
- }
- want := tt.enc
- if want == "" {
- want = tt.path
- }
- if enc != want {
- t.Errorf("encodePath(%q) = %q, want %q", tt.path, enc, want)
- }
- }
-}
-
-var badDecode = []string{
- "github.com/GoogleCloudPlatform/omega",
- "github.com/!google!cloud!platform!/omega",
- "github.com/!0google!cloud!platform/omega",
- "github.com/!_google!cloud!platform/omega",
- "github.com/!!google!cloud!platform/omega",
-}
-
-func TestDecodePath(t *testing.T) {
- // Check invalid decodings.
- for _, bad := range badDecode {
- _, err := decodePath(bad)
- if err == nil {
- t.Errorf("DecodePath(%q): succeeded, want error (invalid decoding)", bad)
- }
- }
-
- // Check encodings.
- for _, tt := range encodeTests {
- enc := tt.enc
- if enc == "" {
- enc = tt.path
- }
- path, err := decodePath(enc)
- if err != nil {
- t.Errorf("decodePath(%q): unexpected error: %v", enc, err)
- continue
- }
- if path != tt.path {
- t.Errorf("decodePath(%q) = %q, want %q", enc, path, tt.path)
- }
- }
-}
diff --git a/libgo/go/cmd/go/internal/sumweb/server.go b/libgo/go/cmd/go/internal/sumweb/server.go
deleted file mode 100644
index 5050805f873..00000000000
--- a/libgo/go/cmd/go/internal/sumweb/server.go
+++ /dev/null
@@ -1,183 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package sumweb implements the HTTP protocols for serving or accessing a go.sum database.
-package sumweb
-
-import (
- "context"
- "internal/lazyregexp"
- "net/http"
- "os"
- "strings"
-
- "cmd/go/internal/tlog"
-)
-
-// A Server provides the external operations
-// (underlying database access and so on)
-// needed to implement the HTTP server Handler.
-type Server interface {
- // NewContext returns the context to use for the request r.
- NewContext(r *http.Request) (context.Context, error)
-
- // Signed returns the signed hash of the latest tree.
- Signed(ctx context.Context) ([]byte, error)
-
- // ReadRecords returns the content for the n records id through id+n-1.
- ReadRecords(ctx context.Context, id, n int64) ([][]byte, error)
-
- // Lookup looks up a record by its associated key ("module@version"),
- // returning the record ID.
- Lookup(ctx context.Context, key string) (int64, error)
-
- // ReadTileData reads the content of tile t.
- // It is only invoked for hash tiles (t.L ≥ 0).
- ReadTileData(ctx context.Context, t tlog.Tile) ([]byte, error)
-}
-
-// A Handler is the go.sum database server handler,
-// which should be invoked to serve the paths listed in Paths.
-// The calling code is responsible for initializing Server.
-type Handler struct {
- Server Server
-}
-
-// Paths are the URL paths for which Handler should be invoked.
-//
-// Typically a server will do:
-//
-// handler := &sumweb.Handler{Server: srv}
-// for _, path := range sumweb.Paths {
-// http.HandleFunc(path, handler)
-// }
-//
-var Paths = []string{
- "/lookup/",
- "/latest",
- "/tile/",
-}
-
-var modVerRE = lazyregexp.New(`^[^@]+@v[0-9]+\.[0-9]+\.[0-9]+(-[^@]*)?(\+incompatible)?$`)
-
-func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- ctx, err := h.Server.NewContext(r)
- if err != nil {
- http.Error(w, err.Error(), 500)
- return
- }
-
- switch {
- default:
- http.NotFound(w, r)
-
- case strings.HasPrefix(r.URL.Path, "/lookup/"):
- mod := strings.TrimPrefix(r.URL.Path, "/lookup/")
- if !modVerRE.MatchString(mod) {
- http.Error(w, "invalid module@version syntax", http.StatusBadRequest)
- return
- }
- i := strings.Index(mod, "@")
- encPath, encVers := mod[:i], mod[i+1:]
- path, err := decodePath(encPath)
- if err != nil {
- reportError(w, r, err)
- return
- }
- vers, err := decodeVersion(encVers)
- if err != nil {
- reportError(w, r, err)
- return
- }
- id, err := h.Server.Lookup(ctx, path+"@"+vers)
- if err != nil {
- reportError(w, r, err)
- return
- }
- records, err := h.Server.ReadRecords(ctx, id, 1)
- if err != nil {
- // This should never happen - the lookup says the record exists.
- http.Error(w, err.Error(), http.StatusInternalServerError)
- return
- }
- if len(records) != 1 {
- http.Error(w, "invalid record count returned by ReadRecords", http.StatusInternalServerError)
- return
- }
- msg, err := tlog.FormatRecord(id, records[0])
- if err != nil {
- http.Error(w, err.Error(), http.StatusInternalServerError)
- return
- }
- signed, err := h.Server.Signed(ctx)
- if err != nil {
- http.Error(w, err.Error(), http.StatusInternalServerError)
- return
- }
- w.Header().Set("Content-Type", "text/plain; charset=UTF-8")
- w.Write(msg)
- w.Write(signed)
-
- case r.URL.Path == "/latest":
- data, err := h.Server.Signed(ctx)
- if err != nil {
- http.Error(w, err.Error(), http.StatusInternalServerError)
- return
- }
- w.Header().Set("Content-Type", "text/plain; charset=UTF-8")
- w.Write(data)
-
- case strings.HasPrefix(r.URL.Path, "/tile/"):
- t, err := tlog.ParseTilePath(r.URL.Path[1:])
- if err != nil {
- http.Error(w, "invalid tile syntax", http.StatusBadRequest)
- return
- }
- if t.L == -1 {
- // Record data.
- start := t.N << uint(t.H)
- records, err := h.Server.ReadRecords(ctx, start, int64(t.W))
- if err != nil {
- reportError(w, r, err)
- return
- }
- if len(records) != t.W {
- http.Error(w, "invalid record count returned by ReadRecords", http.StatusInternalServerError)
- return
- }
- var data []byte
- for i, text := range records {
- msg, err := tlog.FormatRecord(start+int64(i), text)
- if err != nil {
- http.Error(w, err.Error(), http.StatusInternalServerError)
- }
- data = append(data, msg...)
- }
- w.Header().Set("Content-Type", "text/plain; charset=UTF-8")
- w.Write(data)
- return
- }
-
- data, err := h.Server.ReadTileData(ctx, t)
- if err != nil {
- reportError(w, r, err)
- return
- }
- w.Header().Set("Content-Type", "application/octet-stream")
- w.Write(data)
- }
-}
-
-// reportError reports err to w.
-// If it's a not-found, the reported error is 404.
-// Otherwise it is an internal server error.
-// The caller must only call reportError in contexts where
-// a not-found err should be reported as 404.
-func reportError(w http.ResponseWriter, r *http.Request, err error) {
- if os.IsNotExist(err) {
- http.Error(w, err.Error(), http.StatusNotFound)
- return
- }
- http.Error(w, err.Error(), http.StatusInternalServerError)
-}
diff --git a/libgo/go/cmd/go/internal/sumweb/test.go b/libgo/go/cmd/go/internal/sumweb/test.go
deleted file mode 100644
index cce86e7e9af..00000000000
--- a/libgo/go/cmd/go/internal/sumweb/test.go
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package sumweb
-
-import (
- "context"
- "fmt"
- "net/http"
- "strings"
- "sync"
-
- "cmd/go/internal/note"
- "cmd/go/internal/tlog"
-)
-
-// NewTestServer constructs a new TestServer
-// that will sign its tree with the given signer key
-// (see cmd/go/internal/note)
-// and fetch new records as needed by calling gosum.
-func NewTestServer(signer string, gosum func(path, vers string) ([]byte, error)) *TestServer {
- return &TestServer{signer: signer, gosum: gosum}
-}
-
-// A TestServer is an in-memory implementation of Server for testing.
-type TestServer struct {
- signer string
- gosum func(path, vers string) ([]byte, error)
-
- mu sync.Mutex
- hashes testHashes
- records [][]byte
- lookup map[string]int64
-}
-
-// testHashes implements tlog.HashReader, reading from a slice.
-type testHashes []tlog.Hash
-
-func (h testHashes) ReadHashes(indexes []int64) ([]tlog.Hash, error) {
- var list []tlog.Hash
- for _, id := range indexes {
- list = append(list, h[id])
- }
- return list, nil
-}
-
-func (s *TestServer) NewContext(r *http.Request) (context.Context, error) {
- return nil, nil
-}
-
-func (s *TestServer) Signed(ctx context.Context) ([]byte, error) {
- s.mu.Lock()
- defer s.mu.Unlock()
-
- size := int64(len(s.records))
- h, err := tlog.TreeHash(size, s.hashes)
- if err != nil {
- return nil, err
- }
- text := tlog.FormatTree(tlog.Tree{N: size, Hash: h})
- signer, err := note.NewSigner(s.signer)
- if err != nil {
- return nil, err
- }
- return note.Sign(&note.Note{Text: string(text)}, signer)
-}
-
-func (s *TestServer) ReadRecords(ctx context.Context, id, n int64) ([][]byte, error) {
- s.mu.Lock()
- defer s.mu.Unlock()
-
- var list [][]byte
- for i := int64(0); i < n; i++ {
- if id+i >= int64(len(s.records)) {
- return nil, fmt.Errorf("missing records")
- }
- list = append(list, s.records[id+i])
- }
- return list, nil
-}
-
-func (s *TestServer) Lookup(ctx context.Context, key string) (int64, error) {
- s.mu.Lock()
- id, ok := s.lookup[key]
- s.mu.Unlock()
- if ok {
- return id, nil
- }
-
- // Look up module and compute go.sum lines.
- i := strings.Index(key, "@")
- if i < 0 {
- return 0, fmt.Errorf("invalid lookup key %q", key)
- }
- path, vers := key[:i], key[i+1:]
- data, err := s.gosum(path, vers)
- if err != nil {
- return 0, err
- }
-
- s.mu.Lock()
- defer s.mu.Unlock()
-
- // We ran the fetch without the lock.
- // If another fetch happened and committed, use it instead.
- id, ok = s.lookup[key]
- if ok {
- return id, nil
- }
-
- // Add record.
- id = int64(len(s.records))
- s.records = append(s.records, data)
- if s.lookup == nil {
- s.lookup = make(map[string]int64)
- }
- s.lookup[key] = id
- hashes, err := tlog.StoredHashesForRecordHash(id, tlog.RecordHash([]byte(data)), s.hashes)
- if err != nil {
- panic(err)
- }
- s.hashes = append(s.hashes, hashes...)
-
- return id, nil
-}
-
-func (s *TestServer) ReadTileData(ctx context.Context, t tlog.Tile) ([]byte, error) {
- s.mu.Lock()
- defer s.mu.Unlock()
-
- return tlog.ReadTileData(t, s.hashes)
-}
diff --git a/libgo/go/cmd/go/internal/test/test.go b/libgo/go/cmd/go/internal/test/test.go
index 95000011d83..fb011d4c03f 100644
--- a/libgo/go/cmd/go/internal/test/test.go
+++ b/libgo/go/cmd/go/internal/test/test.go
@@ -572,8 +572,9 @@ func runTest(cmd *base.Command, args []string) {
}
// Pass timeout to tests if it exists.
+ // Prepend rather than appending so that it appears before positional arguments.
if testActualTimeout > 0 {
- testArgs = append(testArgs, "-test.timeout="+testActualTimeout.String())
+ testArgs = append([]string{"-test.timeout=" + testActualTimeout.String()}, testArgs...)
}
// show passing test output (after buffering) with -v flag.
@@ -828,7 +829,7 @@ func builderTest(b *work.Builder, p *load.Package) (buildAction, runAction, prin
if p.ImportPath == "command-line-arguments" {
elem = p.Name
} else {
- elem = load.DefaultExecName(p.ImportPath)
+ elem = p.DefaultExecName()
}
testBinary := elem + ".test"
diff --git a/libgo/go/cmd/go/internal/test/testflag.go b/libgo/go/cmd/go/internal/test/testflag.go
index 138e1f9d2a2..e214b1532bd 100644
--- a/libgo/go/cmd/go/internal/test/testflag.go
+++ b/libgo/go/cmd/go/internal/test/testflag.go
@@ -65,7 +65,7 @@ var testFlagDefn = []*cmdflag.Defn{
func init() {
cmdflag.AddKnownFlags("test", testFlagDefn)
var cmd base.Command
- work.AddBuildFlags(&cmd)
+ work.AddBuildFlags(&cmd, work.DefaultBuildFlags)
cmd.Flag.VisitAll(func(f *flag.Flag) {
if f.Name == "v" {
// test overrides the build -v flag
@@ -88,7 +88,8 @@ func init() {
// go test fmt -custom-flag-for-fmt-test
// go test -x math
func testFlags(usage func(), args []string) (packageNames, passToTest []string) {
- args = str.StringList(cmdflag.FindGOFLAGS(testFlagDefn), args)
+ goflags := cmdflag.FindGOFLAGS(testFlagDefn)
+ args = str.StringList(goflags, args)
inPkg := false
var explicitArgs []string
for i := 0; i < len(args); i++ {
@@ -127,6 +128,9 @@ func testFlags(usage func(), args []string) (packageNames, passToTest []string)
passToTest = append(passToTest, args[i])
continue
}
+ if i < len(goflags) {
+ f.Present = false // Not actually present on the command line.
+ }
if f.Value != nil {
if err := f.Value.Set(value); err != nil {
base.Fatalf("invalid flag argument for -%s: %v", f.Name, err)
diff --git a/libgo/go/cmd/go/internal/tlog/ct_test.go b/libgo/go/cmd/go/internal/tlog/ct_test.go
deleted file mode 100644
index c2d9aebe79a..00000000000
--- a/libgo/go/cmd/go/internal/tlog/ct_test.go
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tlog
-
-import (
- "encoding/json"
- "fmt"
- "io/ioutil"
- "net/http"
- "net/url"
- "os"
- "testing"
-)
-
-func TestCertificateTransparency(t *testing.T) {
- // Test that we can verify actual Certificate Transparency proofs.
- // (The other tests check that we can verify our own proofs;
- // this is a test that the two are compatible.)
-
- if testing.Short() {
- t.Skip("skipping in -short mode")
- }
-
- var root ctTree
- httpGET(t, "http://ct.googleapis.com/logs/argon2020/ct/v1/get-sth", &root)
-
- var leaf ctEntries
- httpGET(t, "http://ct.googleapis.com/logs/argon2020/ct/v1/get-entries?start=10000&end=10000", &leaf)
- hash := RecordHash(leaf.Entries[0].Data)
-
- var rp ctRecordProof
- httpGET(t, "http://ct.googleapis.com/logs/argon2020/ct/v1/get-proof-by-hash?tree_size="+fmt.Sprint(root.Size)+"&hash="+url.QueryEscape(hash.String()), &rp)
-
- err := CheckRecord(rp.Proof, root.Size, root.Hash, 10000, hash)
- if err != nil {
- t.Fatal(err)
- }
-
- var tp ctTreeProof
- httpGET(t, "http://ct.googleapis.com/logs/argon2020/ct/v1/get-sth-consistency?first=3654490&second="+fmt.Sprint(root.Size), &tp)
-
- oh, _ := ParseHash("AuIZ5V6sDUj1vn3Y1K85oOaQ7y+FJJKtyRTl1edIKBQ=")
- err = CheckTree(tp.Proof, root.Size, root.Hash, 3654490, oh)
- if err != nil {
- t.Fatal(err)
- }
-}
-
-type ctTree struct {
- Size int64 `json:"tree_size"`
- Hash Hash `json:"sha256_root_hash"`
-}
-
-type ctEntries struct {
- Entries []*ctEntry
-}
-
-type ctEntry struct {
- Data []byte `json:"leaf_input"`
-}
-
-type ctRecordProof struct {
- Index int64 `json:"leaf_index"`
- Proof RecordProof `json:"audit_path"`
-}
-
-type ctTreeProof struct {
- Proof TreeProof `json:"consistency"`
-}
-
-func httpGET(t *testing.T, url string, targ interface{}) {
- if testing.Verbose() {
- println()
- println(url)
- }
- resp, err := http.Get(url)
- if err != nil {
- t.Fatal(err)
- }
- defer resp.Body.Close()
- data, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- t.Fatal(err)
- }
- if testing.Verbose() {
- os.Stdout.Write(data)
- }
- err = json.Unmarshal(data, targ)
- if err != nil {
- println(url)
- os.Stdout.Write(data)
- t.Fatal(err)
- }
-}
diff --git a/libgo/go/cmd/go/internal/tlog/note.go b/libgo/go/cmd/go/internal/tlog/note.go
deleted file mode 100644
index 65c71644baf..00000000000
--- a/libgo/go/cmd/go/internal/tlog/note.go
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tlog
-
-import (
- "bytes"
- "encoding/base64"
- "errors"
- "fmt"
- "strconv"
- "strings"
- "unicode/utf8"
-)
-
-// A Tree is a tree description, to be signed by a go.sum database server.
-type Tree struct {
- N int64
- Hash Hash
-}
-
-// FormatTree formats a tree description for inclusion in a note.
-//
-// The encoded form is three lines, each ending in a newline (U+000A):
-//
-// go.sum database tree
-// N
-// Hash
-//
-// where N is in decimal and Hash is in base64.
-//
-// A future backwards-compatible encoding may add additional lines,
-// which the parser can ignore.
-// A future backwards-incompatible encoding would use a different
-// first line (for example, "go.sum database tree v2").
-func FormatTree(tree Tree) []byte {
- return []byte(fmt.Sprintf("go.sum database tree\n%d\n%s\n", tree.N, tree.Hash))
-}
-
-var errMalformedTree = errors.New("malformed tree note")
-var treePrefix = []byte("go.sum database tree\n")
-
-// ParseTree parses a tree root description.
-func ParseTree(text []byte) (tree Tree, err error) {
- // The message looks like:
- //
- // go.sum database tree
- // 2
- // nND/nri/U0xuHUrYSy0HtMeal2vzD9V4k/BO79C+QeI=
- //
- // For forwards compatibility, extra text lines after the encoding are ignored.
- if !bytes.HasPrefix(text, treePrefix) || bytes.Count(text, []byte("\n")) < 3 || len(text) > 1e6 {
- return Tree{}, errMalformedTree
- }
-
- lines := strings.SplitN(string(text), "\n", 4)
- n, err := strconv.ParseInt(lines[1], 10, 64)
- if err != nil || n < 0 || lines[1] != strconv.FormatInt(n, 10) {
- return Tree{}, errMalformedTree
- }
-
- h, err := base64.StdEncoding.DecodeString(lines[2])
- if err != nil || len(h) != HashSize {
- return Tree{}, errMalformedTree
- }
-
- var hash Hash
- copy(hash[:], h)
- return Tree{n, hash}, nil
-}
-
-var errMalformedRecord = errors.New("malformed record data")
-
-// FormatRecord formats a record for serving to a client
-// in a lookup response or data tile.
-//
-// The encoded form is the record ID as a single number,
-// then the text of the record, and then a terminating blank line.
-// Record text must be valid UTF-8 and must not contain any ASCII control
-// characters (those below U+0020) other than newline (U+000A).
-// It must end in a terminating newline and not contain any blank lines.
-func FormatRecord(id int64, text []byte) (msg []byte, err error) {
- if !isValidRecordText(text) {
- return nil, errMalformedRecord
- }
- msg = []byte(fmt.Sprintf("%d\n", id))
- msg = append(msg, text...)
- msg = append(msg, '\n')
- return msg, nil
-}
-
-// isValidRecordText reports whether text is syntactically valid record text.
-func isValidRecordText(text []byte) bool {
- var last rune
- for i := 0; i < len(text); {
- r, size := utf8.DecodeRune(text[i:])
- if r < 0x20 && r != '\n' || r == utf8.RuneError && size == 1 || last == '\n' && r == '\n' {
- return false
- }
- i += size
- last = r
- }
- if last != '\n' {
- return false
- }
- return true
-}
-
-// ParseRecord parses a record description at the start of text,
-// stopping immediately after the terminating blank line.
-// It returns the record id, the record text, and the remainder of text.
-func ParseRecord(msg []byte) (id int64, text, rest []byte, err error) {
- // Leading record id.
- i := bytes.IndexByte(msg, '\n')
- if i < 0 {
- return 0, nil, nil, errMalformedRecord
- }
- id, err = strconv.ParseInt(string(msg[:i]), 10, 64)
- if err != nil {
- return 0, nil, nil, errMalformedRecord
- }
- msg = msg[i+1:]
-
- // Record text.
- i = bytes.Index(msg, []byte("\n\n"))
- if i < 0 {
- return 0, nil, nil, errMalformedRecord
- }
- text, rest = msg[:i+1], msg[i+2:]
- if !isValidRecordText(text) {
- return 0, nil, nil, errMalformedRecord
- }
- return id, text, rest, nil
-}
diff --git a/libgo/go/cmd/go/internal/tlog/note_test.go b/libgo/go/cmd/go/internal/tlog/note_test.go
deleted file mode 100644
index a32d6d21436..00000000000
--- a/libgo/go/cmd/go/internal/tlog/note_test.go
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tlog
-
-import (
- "strings"
- "testing"
-)
-
-func TestFormatTree(t *testing.T) {
- n := int64(123456789012)
- h := RecordHash([]byte("hello world"))
- golden := "go.sum database tree\n123456789012\nTszzRgjTG6xce+z2AG31kAXYKBgQVtCSCE40HmuwBb0=\n"
- b := FormatTree(Tree{n, h})
- if string(b) != golden {
- t.Errorf("FormatTree(...) = %q, want %q", b, golden)
- }
-}
-
-func TestParseTree(t *testing.T) {
- in := "go.sum database tree\n123456789012\nTszzRgjTG6xce+z2AG31kAXYKBgQVtCSCE40HmuwBb0=\n"
- goldH := RecordHash([]byte("hello world"))
- goldN := int64(123456789012)
- tree, err := ParseTree([]byte(in))
- if tree.N != goldN || tree.Hash != goldH || err != nil {
- t.Fatalf("ParseTree(...) = Tree{%d, %v}, %v, want Tree{%d, %v}, nil", tree.N, tree.Hash, err, goldN, goldH)
- }
-
- // Check invalid trees.
- var badTrees = []string{
- "not-" + in,
- "go.sum database tree\n0xabcdef\nTszzRgjTG6xce+z2AG31kAXYKBgQVtCSCE40HmuwBb0=\n",
- "go.sum database tree\n123456789012\nTszzRgjTG6xce+z2AG31kAXYKBgQVtCSCE40HmuwBTOOBIG=\n",
- }
- for _, bad := range badTrees {
- _, err := ParseTree([]byte(bad))
- if err == nil {
- t.Fatalf("ParseTree(%q) succeeded, want failure", in)
- }
- }
-
- // Check junk on end is ignored.
- var goodTrees = []string{
- in + "JOE",
- in + "JOE\n",
- in + strings.Repeat("JOE\n", 1000),
- }
- for _, good := range goodTrees {
- _, err := ParseTree([]byte(good))
- if tree.N != goldN || tree.Hash != goldH || err != nil {
- t.Fatalf("ParseTree(...+%q) = Tree{%d, %v}, %v, want Tree{%d, %v}, nil", good[len(in):], tree.N, tree.Hash, err, goldN, goldH)
- }
- }
-}
-
-func TestFormatRecord(t *testing.T) {
- id := int64(123456789012)
- text := "hello, world\n"
- golden := "123456789012\nhello, world\n\n"
- msg, err := FormatRecord(id, []byte(text))
- if err != nil {
- t.Fatalf("FormatRecord: %v", err)
- }
- if string(msg) != golden {
- t.Fatalf("FormatRecord(...) = %q, want %q", msg, golden)
- }
-
- var badTexts = []string{
- "",
- "hello\nworld",
- "hello\n\nworld\n",
- "hello\x01world\n",
- }
- for _, bad := range badTexts {
- msg, err := FormatRecord(id, []byte(bad))
- if err == nil {
- t.Errorf("FormatRecord(id, %q) = %q, want error", bad, msg)
- }
- }
-}
-
-func TestParseRecord(t *testing.T) {
- in := "123456789012\nhello, world\n\njunk on end\x01\xff"
- goldID := int64(123456789012)
- goldText := "hello, world\n"
- goldRest := "junk on end\x01\xff"
- id, text, rest, err := ParseRecord([]byte(in))
- if id != goldID || string(text) != goldText || string(rest) != goldRest || err != nil {
- t.Fatalf("ParseRecord(%q) = %d, %q, %q, %v, want %d, %q, %q, nil", in, id, text, rest, err, goldID, goldText, goldRest)
- }
-
- in = "123456789012\nhello, world\n\n"
- id, text, rest, err = ParseRecord([]byte(in))
- if id != goldID || string(text) != goldText || len(rest) != 0 || err != nil {
- t.Fatalf("ParseRecord(%q) = %d, %q, %q, %v, want %d, %q, %q, nil", in, id, text, rest, err, goldID, goldText, "")
- }
- if rest == nil {
- t.Fatalf("ParseRecord(%q): rest = []byte(nil), want []byte{}", in)
- }
-
- // Check invalid records.
- var badRecords = []string{
- "not-" + in,
- "123\nhello\x01world\n\n",
- "123\nhello\xffworld\n\n",
- "123\nhello world\n",
- "0x123\nhello world\n\n",
- }
- for _, bad := range badRecords {
- id, text, rest, err := ParseRecord([]byte(bad))
- if err == nil {
- t.Fatalf("ParseRecord(%q) = %d, %q, %q, nil, want error", in, id, text, rest)
- }
- }
-}
diff --git a/libgo/go/cmd/go/internal/tlog/tile.go b/libgo/go/cmd/go/internal/tlog/tile.go
deleted file mode 100644
index 694d89cdf26..00000000000
--- a/libgo/go/cmd/go/internal/tlog/tile.go
+++ /dev/null
@@ -1,418 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tlog
-
-import (
- "fmt"
- "strconv"
- "strings"
-)
-
-// A Tile is a description of a transparency log tile.
-// A tile of height H at level L offset N lists W consecutive hashes
-// at level H*L of the tree starting at offset N*(2**H).
-// A complete tile lists 2**H hashes; a partial tile lists fewer.
-// Note that a tile represents the entire subtree of height H
-// with those hashes as the leaves. The levels above H*L
-// can be reconstructed by hashing the leaves.
-//
-// Each Tile can be encoded as a “tile coordinate path”
-// of the form tile/H/L/NNN[.p/W].
-// The .p/W suffix is present only for partial tiles, meaning W < 2**H.
-// The NNN element is an encoding of N into 3-digit path elements.
-// All but the last path element begins with an "x".
-// For example,
-// Tile{H: 3, L: 4, N: 1234067, W: 1}'s path
-// is tile/3/4/x001/x234/067.p/1, and
-// Tile{H: 3, L: 4, N: 1234067, W: 8}'s path
-// is tile/3/4/x001/x234/067.
-// See Tile's Path method and the ParseTilePath function.
-//
-// The special level L=-1 holds raw record data instead of hashes.
-// In this case, the level encodes into a tile path as the path element
-// "data" instead of "-1".
-type Tile struct {
- H int // height of tile (1 ≤ H ≤ 30)
- L int // level in tiling (-1 ≤ L ≤ 63)
- N int64 // number within level (0 ≤ N, unbounded)
- W int // width of tile (1 ≤ W ≤ 2**H; 2**H is complete tile)
-}
-
-// TileForIndex returns the tile of height h ≥ 1
-// and least width storing the given hash storage index.
-func TileForIndex(h int, index int64) Tile {
- if h < 1 {
- panic("TileForIndex: invalid height")
- }
- t, _, _ := tileForIndex(h, index)
- return t
-}
-
-// tileForIndex returns the tile of height h ≥ 1
-// storing the given hash index, which can be
-// reconstructed using tileHash(data[start:end]).
-func tileForIndex(h int, index int64) (t Tile, start, end int) {
- level, n := SplitStoredHashIndex(index)
- t.H = h
- t.L = level / h
- level -= t.L * h // now level within tile
- t.N = n << uint(level) >> uint(t.H)
- n -= t.N << uint(t.H) >> uint(level) // now n within tile at level
- t.W = int((n + 1) << uint(level))
- return t, int(n<<uint(level)) * HashSize, int((n+1)<<uint(level)) * HashSize
-}
-
-// HashFromTile returns the hash at the given storage index,
-// provided that t == TileForIndex(t.H, index) or a wider version,
-// and data is t's tile data (of length at least t.W*HashSize).
-func HashFromTile(t Tile, data []byte, index int64) (Hash, error) {
- if t.H < 1 || t.H > 30 || t.L < 0 || t.L >= 64 || t.W < 1 || t.W > 1<<uint(t.H) {
- return Hash{}, fmt.Errorf("invalid tile %v", t.Path())
- }
- if len(data) < t.W*HashSize {
- return Hash{}, fmt.Errorf("data len %d too short for tile %v", len(data), t.Path())
- }
- t1, start, end := tileForIndex(t.H, index)
- if t.L != t1.L || t.N != t1.N || t.W < t1.W {
- return Hash{}, fmt.Errorf("index %v is in %v not %v", index, t1.Path(), t.Path())
- }
- return tileHash(data[start:end]), nil
-}
-
-// tileHash computes the subtree hash corresponding to the (2^K)-1 hashes in data.
-func tileHash(data []byte) Hash {
- if len(data) == 0 {
- panic("bad math in tileHash")
- }
- if len(data) == HashSize {
- var h Hash
- copy(h[:], data)
- return h
- }
- n := len(data) / 2
- return NodeHash(tileHash(data[:n]), tileHash(data[n:]))
-}
-
-// NewTiles returns the coordinates of the tiles of height h ≥ 1
-// that must be published when publishing from a tree of
-// size newTreeSize to replace a tree of size oldTreeSize.
-// (No tiles need to be published for a tree of size zero.)
-func NewTiles(h int, oldTreeSize, newTreeSize int64) []Tile {
- if h < 1 {
- panic(fmt.Sprintf("NewTiles: invalid height %d", h))
- }
- H := uint(h)
- var tiles []Tile
- for level := uint(0); newTreeSize>>(H*level) > 0; level++ {
- oldN := oldTreeSize >> (H * level)
- newN := newTreeSize >> (H * level)
- for n := oldN >> H; n < newN>>H; n++ {
- tiles = append(tiles, Tile{H: h, L: int(level), N: n, W: 1 << H})
- }
- n := newN >> H
- maxW := int(newN - n<<H)
- minW := 1
- if oldN > n<<H {
- minW = int(oldN - n<<H)
- }
- for w := minW; w <= maxW; w++ {
- tiles = append(tiles, Tile{H: h, L: int(level), N: n, W: w})
- }
- }
- return tiles
-}
-
-// ReadTileData reads the hashes for tile t from r
-// and returns the corresponding tile data.
-func ReadTileData(t Tile, r HashReader) ([]byte, error) {
- size := t.W
- if size == 0 {
- size = 1 << uint(t.H)
- }
- start := t.N << uint(t.H)
- indexes := make([]int64, size)
- for i := 0; i < size; i++ {
- indexes[i] = StoredHashIndex(t.H*t.L, start+int64(i))
- }
-
- hashes, err := r.ReadHashes(indexes)
- if err != nil {
- return nil, err
- }
- if len(hashes) != len(indexes) {
- return nil, fmt.Errorf("tlog: ReadHashes(%d indexes) = %d hashes", len(indexes), len(hashes))
- }
-
- tile := make([]byte, size*HashSize)
- for i := 0; i < size; i++ {
- copy(tile[i*HashSize:], hashes[i][:])
- }
- return tile, nil
-}
-
-// To limit the size of any particular directory listing,
-// we encode the (possibly very large) number N
-// by encoding three digits at a time.
-// For example, 123456789 encodes as x123/x456/789.
-// Each directory has at most 1000 each xNNN, NNN, and NNN.p children,
-// so there are at most 3000 entries in any one directory.
-const pathBase = 1000
-
-// Path returns a tile coordinate path describing t.
-func (t Tile) Path() string {
- n := t.N
- nStr := fmt.Sprintf("%03d", n%pathBase)
- for n >= pathBase {
- n /= pathBase
- nStr = fmt.Sprintf("x%03d/%s", n%pathBase, nStr)
- }
- pStr := ""
- if t.W != 1<<uint(t.H) {
- pStr = fmt.Sprintf(".p/%d", t.W)
- }
- var L string
- if t.L == -1 {
- L = "data"
- } else {
- L = fmt.Sprintf("%d", t.L)
- }
- return fmt.Sprintf("tile/%d/%s/%s%s", t.H, L, nStr, pStr)
-}
-
-// ParseTilePath parses a tile coordinate path.
-func ParseTilePath(path string) (Tile, error) {
- f := strings.Split(path, "/")
- if len(f) < 4 || f[0] != "tile" {
- return Tile{}, &badPathError{path}
- }
- h, err1 := strconv.Atoi(f[1])
- isData := false
- if f[2] == "data" {
- isData = true
- f[2] = "0"
- }
- l, err2 := strconv.Atoi(f[2])
- if err1 != nil || err2 != nil || h < 1 || l < 0 || h > 30 {
- return Tile{}, &badPathError{path}
- }
- w := 1 << uint(h)
- if dotP := f[len(f)-2]; strings.HasSuffix(dotP, ".p") {
- ww, err := strconv.Atoi(f[len(f)-1])
- if err != nil || ww <= 0 || ww >= w {
- return Tile{}, &badPathError{path}
- }
- w = ww
- f[len(f)-2] = dotP[:len(dotP)-len(".p")]
- f = f[:len(f)-1]
- }
- f = f[3:]
- n := int64(0)
- for _, s := range f {
- nn, err := strconv.Atoi(strings.TrimPrefix(s, "x"))
- if err != nil || nn < 0 || nn >= pathBase {
- return Tile{}, &badPathError{path}
- }
- n = n*pathBase + int64(nn)
- }
- if isData {
- l = -1
- }
- t := Tile{H: h, L: l, N: n, W: w}
- if path != t.Path() {
- return Tile{}, &badPathError{path}
- }
- return t, nil
-}
-
-type badPathError struct {
- path string
-}
-
-func (e *badPathError) Error() string {
- return fmt.Sprintf("malformed tile path %q", e.path)
-}
-
-// A TileReader reads tiles from a go.sum database log.
-type TileReader interface {
- // Height returns the height of the available tiles.
- Height() int
-
- // ReadTiles returns the data for each requested tile.
- // If ReadTiles returns err == nil, it must also return
- // a data record for each tile (len(data) == len(tiles))
- // and each data record must be the correct length
- // (len(data[i]) == tiles[i].W*HashSize).
- ReadTiles(tiles []Tile) (data [][]byte, err error)
-
- // SaveTiles informs the TileReader that the tile data
- // returned by ReadTiles has been confirmed as valid
- // and can be saved in persistent storage (on disk).
- SaveTiles(tiles []Tile, data [][]byte)
-}
-
-// TileHashReader returns a HashReader that satisfies requests
-// by loading tiles of the given tree.
-//
-// The returned HashReader checks that loaded tiles are
-// valid for the given tree. Therefore, any hashes returned
-// by the HashReader are already proven to be in the tree.
-func TileHashReader(tree Tree, tr TileReader) HashReader {
- return &tileHashReader{tree: tree, tr: tr}
-}
-
-type tileHashReader struct {
- tree Tree
- tr TileReader
-}
-
-// tileParent returns t's k'th tile parent in the tiles for a tree of size n.
-// If there is no such parent, tileParent returns Tile{}.
-func tileParent(t Tile, k int, n int64) Tile {
- t.L += k
- t.N >>= uint(k * t.H)
- t.W = 1 << uint(t.H)
- if max := n >> uint(t.L*t.H); t.N<<uint(t.H)+int64(t.W) >= max {
- if t.N<<uint(t.H) >= max {
- return Tile{}
- }
- t.W = int(max - t.N<<uint(t.H))
- }
- return t
-}
-
-func (r *tileHashReader) ReadHashes(indexes []int64) ([]Hash, error) {
- h := r.tr.Height()
-
- tileOrder := make(map[Tile]int) // tileOrder[tileKey(tiles[i])] = i
- var tiles []Tile
-
- // Plan to fetch tiles necessary to recompute tree hash.
- // If it matches, those tiles are authenticated.
- stx := subTreeIndex(0, r.tree.N, nil)
- stxTileOrder := make([]int, len(stx))
- for i, x := range stx {
- tile, _, _ := tileForIndex(h, x)
- tile = tileParent(tile, 0, r.tree.N)
- if j, ok := tileOrder[tile]; ok {
- stxTileOrder[i] = j
- continue
- }
- stxTileOrder[i] = len(tiles)
- tileOrder[tile] = len(tiles)
- tiles = append(tiles, tile)
- }
-
- // Plan to fetch tiles containing the indexes,
- // along with any parent tiles needed
- // for authentication. For most calls,
- // the parents are being fetched anyway.
- indexTileOrder := make([]int, len(indexes))
- for i, x := range indexes {
- if x >= StoredHashIndex(0, r.tree.N) {
- return nil, fmt.Errorf("indexes not in tree")
- }
-
- tile, _, _ := tileForIndex(h, x)
-
- // Walk up parent tiles until we find one we've requested.
- // That one will be authenticated.
- k := 0
- for ; ; k++ {
- p := tileParent(tile, k, r.tree.N)
- if j, ok := tileOrder[p]; ok {
- if k == 0 {
- indexTileOrder[i] = j
- }
- break
- }
- }
-
- // Walk back down recording child tiles after parents.
- // This loop ends by revisiting the tile for this index
- // (tileParent(tile, 0, r.tree.N)) unless k == 0, in which
- // case the previous loop did it.
- for k--; k >= 0; k-- {
- p := tileParent(tile, k, r.tree.N)
- if p.W != 1<<uint(p.H) {
- // Only full tiles have parents.
- // This tile has a parent, so it must be full.
- return nil, fmt.Errorf("bad math in tileHashReader: %d %d %v", r.tree.N, x, p)
- }
- tileOrder[p] = len(tiles)
- if k == 0 {
- indexTileOrder[i] = len(tiles)
- }
- tiles = append(tiles, p)
- }
- }
-
- // Fetch all the tile data.
- data, err := r.tr.ReadTiles(tiles)
- if err != nil {
- return nil, err
- }
- if len(data) != len(tiles) {
- return nil, fmt.Errorf("TileReader returned bad result slice (len=%d, want %d)", len(data), len(tiles))
- }
- for i, tile := range tiles {
- if len(data[i]) != tile.W*HashSize {
- return nil, fmt.Errorf("TileReader returned bad result slice (%v len=%d, want %d)", tile.Path(), len(data[i]), tile.W*HashSize)
- }
- }
-
- // Authenticate the initial tiles against the tree hash.
- // They are arranged so that parents are authenticated before children.
- // First the tiles needed for the tree hash.
- th, err := HashFromTile(tiles[stxTileOrder[len(stx)-1]], data[stxTileOrder[len(stx)-1]], stx[len(stx)-1])
- if err != nil {
- return nil, err
- }
- for i := len(stx) - 2; i >= 0; i-- {
- h, err := HashFromTile(tiles[stxTileOrder[i]], data[stxTileOrder[i]], stx[i])
- if err != nil {
- return nil, err
- }
- th = NodeHash(h, th)
- }
- if th != r.tree.Hash {
- // The tiles do not support the tree hash.
- // We know at least one is wrong, but not which one.
- return nil, fmt.Errorf("downloaded inconsistent tile")
- }
-
- // Authenticate full tiles against their parents.
- for i := len(stx); i < len(tiles); i++ {
- tile := tiles[i]
- p := tileParent(tile, 1, r.tree.N)
- j, ok := tileOrder[p]
- if !ok {
- return nil, fmt.Errorf("bad math in tileHashReader %d %v: lost parent of %v", r.tree.N, indexes, tile)
- }
- h, err := HashFromTile(p, data[j], StoredHashIndex(p.L*p.H, tile.N))
- if err != nil {
- return nil, fmt.Errorf("bad math in tileHashReader %d %v: lost hash of %v: %v", r.tree.N, indexes, tile, err)
- }
- if h != tileHash(data[i]) {
- return nil, fmt.Errorf("downloaded inconsistent tile")
- }
- }
-
- // Now we have all the tiles needed for the requested hashes,
- // and we've authenticated the full tile set against the trusted tree hash.
- r.tr.SaveTiles(tiles, data)
-
- // Pull out the requested hashes.
- hashes := make([]Hash, len(indexes))
- for i, x := range indexes {
- j := indexTileOrder[i]
- h, err := HashFromTile(tiles[j], data[j], x)
- if err != nil {
- return nil, fmt.Errorf("bad math in tileHashReader %d %v: lost hash %v: %v", r.tree.N, indexes, x, err)
- }
- hashes[i] = h
- }
-
- return hashes, nil
-}
diff --git a/libgo/go/cmd/go/internal/tlog/tlog.go b/libgo/go/cmd/go/internal/tlog/tlog.go
deleted file mode 100644
index 6703656b19f..00000000000
--- a/libgo/go/cmd/go/internal/tlog/tlog.go
+++ /dev/null
@@ -1,601 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package tlog implements a tamper-evident log
-// used in the Go module go.sum database server.
-//
-// This package is part of a DRAFT of what the go.sum database server will look like.
-// Do not assume the details here are final!
-//
-// This package follows the design of Certificate Transparency (RFC 6962)
-// and its proofs are compatible with that system.
-// See TestCertificateTransparency.
-//
-package tlog
-
-import (
- "crypto/sha256"
- "encoding/base64"
- "errors"
- "fmt"
- "math/bits"
-)
-
-// A Hash is a hash identifying a log record or tree root.
-type Hash [HashSize]byte
-
-// HashSize is the size of a Hash in bytes.
-const HashSize = 32
-
-// String returns a base64 representation of the hash for printing.
-func (h Hash) String() string {
- return base64.StdEncoding.EncodeToString(h[:])
-}
-
-// MarshalJSON marshals the hash as a JSON string containing the base64-encoded hash.
-func (h Hash) MarshalJSON() ([]byte, error) {
- return []byte(`"` + h.String() + `"`), nil
-}
-
-// UnmarshalJSON unmarshals a hash from JSON string containing the a base64-encoded hash.
-func (h *Hash) UnmarshalJSON(data []byte) error {
- if len(data) != 1+44+1 || data[0] != '"' || data[len(data)-2] != '=' || data[len(data)-1] != '"' {
- return errors.New("cannot decode hash")
- }
-
- // As of Go 1.12, base64.StdEncoding.Decode insists on
- // slicing into target[33:] even when it only writes 32 bytes.
- // Since we already checked that the hash ends in = above,
- // we can use base64.RawStdEncoding with the = removed;
- // RawStdEncoding does not exhibit the same bug.
- // We decode into a temporary to avoid writing anything to *h
- // unless the entire input is well-formed.
- var tmp Hash
- n, err := base64.RawStdEncoding.Decode(tmp[:], data[1:len(data)-2])
- if err != nil || n != HashSize {
- return errors.New("cannot decode hash")
- }
- *h = tmp
- return nil
-}
-
-// ParseHash parses the base64-encoded string form of a hash.
-func ParseHash(s string) (Hash, error) {
- data, err := base64.StdEncoding.DecodeString(s)
- if err != nil || len(data) != HashSize {
- return Hash{}, fmt.Errorf("malformed hash")
- }
- var h Hash
- copy(h[:], data)
- return h, nil
-}
-
-// maxpow2 returns k, the maximum power of 2 smaller than n,
-// as well as l = log₂ k (so k = 1<<l).
-func maxpow2(n int64) (k int64, l int) {
- l = 0
- for 1<<uint(l+1) < n {
- l++
- }
- return 1 << uint(l), l
-}
-
-var zeroPrefix = []byte{0x00}
-
-// RecordHash returns the content hash for the given record data.
-func RecordHash(data []byte) Hash {
- // SHA256(0x00 || data)
- // https://tools.ietf.org/html/rfc6962#section-2.1
- h := sha256.New()
- h.Write(zeroPrefix)
- h.Write(data)
- var h1 Hash
- h.Sum(h1[:0])
- return h1
-}
-
-// NodeHash returns the hash for an interior tree node with the given left and right hashes.
-func NodeHash(left, right Hash) Hash {
- // SHA256(0x01 || left || right)
- // https://tools.ietf.org/html/rfc6962#section-2.1
- // We use a stack buffer to assemble the hash input
- // to avoid allocating a hash struct with sha256.New.
- var buf [1 + HashSize + HashSize]byte
- buf[0] = 0x01
- copy(buf[1:], left[:])
- copy(buf[1+HashSize:], right[:])
- return sha256.Sum256(buf[:])
-}
-
-// For information about the stored hash index ordering,
-// see section 3.3 of Crosby and Wallach's paper
-// "Efficient Data Structures for Tamper-Evident Logging".
-// https://www.usenix.org/legacy/event/sec09/tech/full_papers/crosby.pdf
-
-// StoredHashIndex maps the tree coordinates (level, n)
-// to a dense linear ordering that can be used for hash storage.
-// Hash storage implementations that store hashes in sequential
-// storage can use this function to compute where to read or write
-// a given hash.
-func StoredHashIndex(level int, n int64) int64 {
- // Level L's n'th hash is written right after level L+1's 2n+1'th hash.
- // Work our way down to the level 0 ordering.
- // We'll add back the orignal level count at the end.
- for l := level; l > 0; l-- {
- n = 2*n + 1
- }
-
- // Level 0's n'th hash is written at n+n/2+n/4+... (eventually n/2ⁱ hits zero).
- i := int64(0)
- for ; n > 0; n >>= 1 {
- i += n
- }
-
- return i + int64(level)
-}
-
-// SplitStoredHashIndex is the inverse of StoredHashIndex.
-// That is, SplitStoredHashIndex(StoredHashIndex(level, n)) == level, n.
-func SplitStoredHashIndex(index int64) (level int, n int64) {
- // Determine level 0 record before index.
- // StoredHashIndex(0, n) < 2*n,
- // so the n we want is in [index/2, index/2+log₂(index)].
- n = index / 2
- indexN := StoredHashIndex(0, n)
- if indexN > index {
- panic("bad math")
- }
- for {
- // Each new record n adds 1 + trailingZeros(n) hashes.
- x := indexN + 1 + int64(bits.TrailingZeros64(uint64(n+1)))
- if x > index {
- break
- }
- n++
- indexN = x
- }
- // The hash we want was commited with record n,
- // meaning it is one of (0, n), (1, n/2), (2, n/4), ...
- level = int(index - indexN)
- return level, n >> uint(level)
-}
-
-// StoredHashCount returns the number of stored hashes
-// that are expected for a tree with n records.
-func StoredHashCount(n int64) int64 {
- if n == 0 {
- return 0
- }
- // The tree will have the hashes up to the last leaf hash.
- numHash := StoredHashIndex(0, n-1) + 1
- // And it will have any hashes for subtrees completed by that leaf.
- for i := uint64(n - 1); i&1 != 0; i >>= 1 {
- numHash++
- }
- return numHash
-}
-
-// StoredHashes returns the hashes that must be stored when writing
-// record n with the given data. The hashes should be stored starting
-// at StoredHashIndex(0, n). The result will have at most 1 + log₂ n hashes,
-// but it will average just under two per call for a sequence of calls for n=1..k.
-//
-// StoredHashes may read up to log n earlier hashes from r
-// in order to compute hashes for completed subtrees.
-func StoredHashes(n int64, data []byte, r HashReader) ([]Hash, error) {
- return StoredHashesForRecordHash(n, RecordHash(data), r)
-}
-
-// StoredHashesForRecordHash is like StoredHashes but takes
-// as its second argument RecordHash(data) instead of data itself.
-func StoredHashesForRecordHash(n int64, h Hash, r HashReader) ([]Hash, error) {
- // Start with the record hash.
- hashes := []Hash{h}
-
- // Build list of indexes needed for hashes for completed subtrees.
- // Each trailing 1 bit in the binary representation of n completes a subtree
- // and consumes a hash from an adjacent subtree.
- m := int(bits.TrailingZeros64(uint64(n + 1)))
- indexes := make([]int64, m)
- for i := 0; i < m; i++ {
- // We arrange indexes in sorted order.
- // Note that n>>i is always odd.
- indexes[m-1-i] = StoredHashIndex(i, n>>uint(i)-1)
- }
-
- // Fetch hashes.
- old, err := r.ReadHashes(indexes)
- if err != nil {
- return nil, err
- }
- if len(old) != len(indexes) {
- return nil, fmt.Errorf("tlog: ReadHashes(%d indexes) = %d hashes", len(indexes), len(old))
- }
-
- // Build new hashes.
- for i := 0; i < m; i++ {
- h = NodeHash(old[m-1-i], h)
- hashes = append(hashes, h)
- }
- return hashes, nil
-}
-
-// A HashReader can read hashes for nodes in the log's tree structure.
-type HashReader interface {
- // ReadHashes returns the hashes with the given stored hash indexes
- // (see StoredHashIndex and SplitStoredHashIndex).
- // ReadHashes must return a slice of hashes the same length as indexes,
- // or else it must return a non-nil error.
- // ReadHashes may run faster if indexes is sorted in increasing order.
- ReadHashes(indexes []int64) ([]Hash, error)
-}
-
-// A HashReaderFunc is a function implementing HashReader.
-type HashReaderFunc func([]int64) ([]Hash, error)
-
-func (f HashReaderFunc) ReadHashes(indexes []int64) ([]Hash, error) {
- return f(indexes)
-}
-
-// TreeHash computes the hash for the root of the tree with n records,
-// using the HashReader to obtain previously stored hashes
-// (those returned by StoredHashes during the writes of those n records).
-// TreeHash makes a single call to ReadHash requesting at most 1 + log₂ n hashes.
-// The tree of size zero is defined to have an all-zero Hash.
-func TreeHash(n int64, r HashReader) (Hash, error) {
- if n == 0 {
- return Hash{}, nil
- }
- indexes := subTreeIndex(0, n, nil)
- hashes, err := r.ReadHashes(indexes)
- if err != nil {
- return Hash{}, err
- }
- if len(hashes) != len(indexes) {
- return Hash{}, fmt.Errorf("tlog: ReadHashes(%d indexes) = %d hashes", len(indexes), len(hashes))
- }
- hash, hashes := subTreeHash(0, n, hashes)
- if len(hashes) != 0 {
- panic("tlog: bad index math in TreeHash")
- }
- return hash, nil
-}
-
-// subTreeIndex returns the storage indexes needed to compute
-// the hash for the subtree containing records [lo, hi),
-// appending them to need and returning the result.
-// See https://tools.ietf.org/html/rfc6962#section-2.1
-func subTreeIndex(lo, hi int64, need []int64) []int64 {
- // See subTreeHash below for commentary.
- for lo < hi {
- k, level := maxpow2(hi - lo + 1)
- if lo&(k-1) != 0 {
- panic("tlog: bad math in subTreeIndex")
- }
- need = append(need, StoredHashIndex(level, lo>>uint(level)))
- lo += k
- }
- return need
-}
-
-// subTreeHash computes the hash for the subtree containing records [lo, hi),
-// assuming that hashes are the hashes corresponding to the indexes
-// returned by subTreeIndex(lo, hi).
-// It returns any leftover hashes.
-func subTreeHash(lo, hi int64, hashes []Hash) (Hash, []Hash) {
- // Repeatedly partition the tree into a left side with 2^level nodes,
- // for as large a level as possible, and a right side with the fringe.
- // The left hash is stored directly and can be read from storage.
- // The right side needs further computation.
- numTree := 0
- for lo < hi {
- k, _ := maxpow2(hi - lo + 1)
- if lo&(k-1) != 0 || lo >= hi {
- panic("tlog: bad math in subTreeHash")
- }
- numTree++
- lo += k
- }
-
- if len(hashes) < numTree {
- panic("tlog: bad index math in subTreeHash")
- }
-
- // Reconstruct hash.
- h := hashes[numTree-1]
- for i := numTree - 2; i >= 0; i-- {
- h = NodeHash(hashes[i], h)
- }
- return h, hashes[numTree:]
-}
-
-// A RecordProof is a verifiable proof that a particular log root contains a particular record.
-// RFC 6962 calls this a “Merkle audit path.”
-type RecordProof []Hash
-
-// ProveRecord returns the proof that the tree of size t contains the record with index n.
-func ProveRecord(t, n int64, r HashReader) (RecordProof, error) {
- if t < 0 || n < 0 || n >= t {
- return nil, fmt.Errorf("tlog: invalid inputs in ProveRecord")
- }
- indexes := leafProofIndex(0, t, n, nil)
- if len(indexes) == 0 {
- return RecordProof{}, nil
- }
- hashes, err := r.ReadHashes(indexes)
- if err != nil {
- return nil, err
- }
- if len(hashes) != len(indexes) {
- return nil, fmt.Errorf("tlog: ReadHashes(%d indexes) = %d hashes", len(indexes), len(hashes))
- }
-
- p, hashes := leafProof(0, t, n, hashes)
- if len(hashes) != 0 {
- panic("tlog: bad index math in ProveRecord")
- }
- return p, nil
-}
-
-// leafProofIndex builds the list of indexes needed to construct the proof
-// that leaf n is contained in the subtree with leaves [lo, hi).
-// It appends those indexes to need and returns the result.
-// See https://tools.ietf.org/html/rfc6962#section-2.1.1
-func leafProofIndex(lo, hi, n int64, need []int64) []int64 {
- // See leafProof below for commentary.
- if !(lo <= n && n < hi) {
- panic("tlog: bad math in leafProofIndex")
- }
- if lo+1 == hi {
- return need
- }
- if k, _ := maxpow2(hi - lo); n < lo+k {
- need = leafProofIndex(lo, lo+k, n, need)
- need = subTreeIndex(lo+k, hi, need)
- } else {
- need = subTreeIndex(lo, lo+k, need)
- need = leafProofIndex(lo+k, hi, n, need)
- }
- return need
-}
-
-// leafProof constructs the proof that leaf n is contained in the subtree with leaves [lo, hi).
-// It returns any leftover hashes as well.
-// See https://tools.ietf.org/html/rfc6962#section-2.1.1
-func leafProof(lo, hi, n int64, hashes []Hash) (RecordProof, []Hash) {
- // We must have lo <= n < hi or else the code here has a bug.
- if !(lo <= n && n < hi) {
- panic("tlog: bad math in leafProof")
- }
-
- if lo+1 == hi { // n == lo
- // Reached the leaf node.
- // The verifier knows what the leaf hash is, so we don't need to send it.
- return RecordProof{}, hashes
- }
-
- // Walk down the tree toward n.
- // Record the hash of the path not taken (needed for verifying the proof).
- var p RecordProof
- var th Hash
- if k, _ := maxpow2(hi - lo); n < lo+k {
- // n is on left side
- p, hashes = leafProof(lo, lo+k, n, hashes)
- th, hashes = subTreeHash(lo+k, hi, hashes)
- } else {
- // n is on right side
- th, hashes = subTreeHash(lo, lo+k, hashes)
- p, hashes = leafProof(lo+k, hi, n, hashes)
- }
- return append(p, th), hashes
-}
-
-var errProofFailed = errors.New("invalid transparency proof")
-
-// CheckRecord verifies that p is a valid proof that the tree of size t
-// with hash th has an n'th record with hash h.
-func CheckRecord(p RecordProof, t int64, th Hash, n int64, h Hash) error {
- if t < 0 || n < 0 || n >= t {
- return fmt.Errorf("tlog: invalid inputs in CheckRecord")
- }
- th2, err := runRecordProof(p, 0, t, n, h)
- if err != nil {
- return err
- }
- if th2 == th {
- return nil
- }
- return errProofFailed
-}
-
-// runRecordProof runs the proof p that leaf n is contained in the subtree with leaves [lo, hi).
-// Running the proof means constructing and returning the implied hash of that
-// subtree.
-func runRecordProof(p RecordProof, lo, hi, n int64, leafHash Hash) (Hash, error) {
- // We must have lo <= n < hi or else the code here has a bug.
- if !(lo <= n && n < hi) {
- panic("tlog: bad math in runRecordProof")
- }
-
- if lo+1 == hi { // m == lo
- // Reached the leaf node.
- // The proof must not have any unnecessary hashes.
- if len(p) != 0 {
- return Hash{}, errProofFailed
- }
- return leafHash, nil
- }
-
- if len(p) == 0 {
- return Hash{}, errProofFailed
- }
-
- k, _ := maxpow2(hi - lo)
- if n < lo+k {
- th, err := runRecordProof(p[:len(p)-1], lo, lo+k, n, leafHash)
- if err != nil {
- return Hash{}, err
- }
- return NodeHash(th, p[len(p)-1]), nil
- } else {
- th, err := runRecordProof(p[:len(p)-1], lo+k, hi, n, leafHash)
- if err != nil {
- return Hash{}, err
- }
- return NodeHash(p[len(p)-1], th), nil
- }
-}
-
-// A TreeProof is a verifiable proof that a particular log tree contains
-// as a prefix all records present in an earlier tree.
-// RFC 6962 calls this a “Merkle consistency proof.”
-type TreeProof []Hash
-
-// ProveTree returns the proof that the tree of size t contains
-// as a prefix all the records from the tree of smaller size n.
-func ProveTree(t, n int64, h HashReader) (TreeProof, error) {
- if t < 1 || n < 1 || n > t {
- return nil, fmt.Errorf("tlog: invalid inputs in ProveTree")
- }
- indexes := treeProofIndex(0, t, n, nil)
- if len(indexes) == 0 {
- return TreeProof{}, nil
- }
- hashes, err := h.ReadHashes(indexes)
- if err != nil {
- return nil, err
- }
- if len(hashes) != len(indexes) {
- return nil, fmt.Errorf("tlog: ReadHashes(%d indexes) = %d hashes", len(indexes), len(hashes))
- }
-
- p, hashes := treeProof(0, t, n, hashes)
- if len(hashes) != 0 {
- panic("tlog: bad index math in ProveTree")
- }
- return p, nil
-}
-
-// treeProofIndex builds the list of indexes needed to construct
-// the sub-proof related to the subtree containing records [lo, hi).
-// See https://tools.ietf.org/html/rfc6962#section-2.1.2.
-func treeProofIndex(lo, hi, n int64, need []int64) []int64 {
- // See treeProof below for commentary.
- if !(lo < n && n <= hi) {
- panic("tlog: bad math in treeProofIndex")
- }
-
- if n == hi {
- if lo == 0 {
- return need
- }
- return subTreeIndex(lo, hi, need)
- }
-
- if k, _ := maxpow2(hi - lo); n <= lo+k {
- need = treeProofIndex(lo, lo+k, n, need)
- need = subTreeIndex(lo+k, hi, need)
- } else {
- need = subTreeIndex(lo, lo+k, need)
- need = treeProofIndex(lo+k, hi, n, need)
- }
- return need
-}
-
-// treeProof constructs the sub-proof related to the subtree containing records [lo, hi).
-// It returns any leftover hashes as well.
-// See https://tools.ietf.org/html/rfc6962#section-2.1.2.
-func treeProof(lo, hi, n int64, hashes []Hash) (TreeProof, []Hash) {
- // We must have lo < n <= hi or else the code here has a bug.
- if !(lo < n && n <= hi) {
- panic("tlog: bad math in treeProof")
- }
-
- // Reached common ground.
- if n == hi {
- if lo == 0 {
- // This subtree corresponds exactly to the old tree.
- // The verifier knows that hash, so we don't need to send it.
- return TreeProof{}, hashes
- }
- th, hashes := subTreeHash(lo, hi, hashes)
- return TreeProof{th}, hashes
- }
-
- // Interior node for the proof.
- // Decide whether to walk down the left or right side.
- var p TreeProof
- var th Hash
- if k, _ := maxpow2(hi - lo); n <= lo+k {
- // m is on left side
- p, hashes = treeProof(lo, lo+k, n, hashes)
- th, hashes = subTreeHash(lo+k, hi, hashes)
- } else {
- // m is on right side
- th, hashes = subTreeHash(lo, lo+k, hashes)
- p, hashes = treeProof(lo+k, hi, n, hashes)
- }
- return append(p, th), hashes
-}
-
-// CheckTree verifies that p is a valid proof that the tree of size t with hash th
-// contains as a prefix the tree of size n with hash h.
-func CheckTree(p TreeProof, t int64, th Hash, n int64, h Hash) error {
- if t < 1 || n < 1 || n > t {
- return fmt.Errorf("tlog: invalid inputs in CheckTree")
- }
- h2, th2, err := runTreeProof(p, 0, t, n, h)
- if err != nil {
- return err
- }
- if th2 == th && h2 == h {
- return nil
- }
- return errProofFailed
-}
-
-// runTreeProof runs the sub-proof p related to the subtree containing records [lo, hi),
-// where old is the hash of the old tree with n records.
-// Running the proof means constructing and returning the implied hashes of that
-// subtree in both the old and new tree.
-func runTreeProof(p TreeProof, lo, hi, n int64, old Hash) (Hash, Hash, error) {
- // We must have lo < n <= hi or else the code here has a bug.
- if !(lo < n && n <= hi) {
- panic("tlog: bad math in runTreeProof")
- }
-
- // Reached common ground.
- if n == hi {
- if lo == 0 {
- if len(p) != 0 {
- return Hash{}, Hash{}, errProofFailed
- }
- return old, old, nil
- }
- if len(p) != 1 {
- return Hash{}, Hash{}, errProofFailed
- }
- return p[0], p[0], nil
- }
-
- if len(p) == 0 {
- return Hash{}, Hash{}, errProofFailed
- }
-
- // Interior node for the proof.
- k, _ := maxpow2(hi - lo)
- if n <= lo+k {
- oh, th, err := runTreeProof(p[:len(p)-1], lo, lo+k, n, old)
- if err != nil {
- return Hash{}, Hash{}, err
- }
- return oh, NodeHash(th, p[len(p)-1]), nil
- } else {
- oh, th, err := runTreeProof(p[:len(p)-1], lo+k, hi, n, old)
- if err != nil {
- return Hash{}, Hash{}, err
- }
- return NodeHash(p[len(p)-1], oh), NodeHash(p[len(p)-1], th), nil
- }
-}
diff --git a/libgo/go/cmd/go/internal/tlog/tlog_test.go b/libgo/go/cmd/go/internal/tlog/tlog_test.go
deleted file mode 100644
index 584e728c1bb..00000000000
--- a/libgo/go/cmd/go/internal/tlog/tlog_test.go
+++ /dev/null
@@ -1,269 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tlog
-
-import (
- "bytes"
- "fmt"
- "testing"
-)
-
-type testHashStorage []Hash
-
-func (t testHashStorage) ReadHash(level int, n int64) (Hash, error) {
- return t[StoredHashIndex(level, n)], nil
-}
-
-func (t testHashStorage) ReadHashes(index []int64) ([]Hash, error) {
- // It's not required by HashReader that indexes be in increasing order,
- // but check that the functions we are testing only ever ask for
- // indexes in increasing order.
- for i := 1; i < len(index); i++ {
- if index[i-1] >= index[i] {
- panic("indexes out of order")
- }
- }
-
- out := make([]Hash, len(index))
- for i, x := range index {
- out[i] = t[x]
- }
- return out, nil
-}
-
-type testTilesStorage struct {
- unsaved int
- m map[Tile][]byte
-}
-
-func (t testTilesStorage) Height() int {
- return 2
-}
-
-func (t *testTilesStorage) SaveTiles(tiles []Tile, data [][]byte) {
- t.unsaved -= len(tiles)
-}
-
-func (t *testTilesStorage) ReadTiles(tiles []Tile) ([][]byte, error) {
- out := make([][]byte, len(tiles))
- for i, tile := range tiles {
- out[i] = t.m[tile]
- }
- t.unsaved += len(tiles)
- return out, nil
-}
-
-func TestTree(t *testing.T) {
- var trees []Hash
- var leafhashes []Hash
- var storage testHashStorage
- tiles := make(map[Tile][]byte)
- const testH = 2
- for i := int64(0); i < 100; i++ {
- data := []byte(fmt.Sprintf("leaf %d", i))
- hashes, err := StoredHashes(i, data, storage)
- if err != nil {
- t.Fatal(err)
- }
- leafhashes = append(leafhashes, RecordHash(data))
- oldStorage := len(storage)
- storage = append(storage, hashes...)
- if count := StoredHashCount(i + 1); count != int64(len(storage)) {
- t.Errorf("StoredHashCount(%d) = %d, have %d StoredHashes", i+1, count, len(storage))
- }
- th, err := TreeHash(i+1, storage)
- if err != nil {
- t.Fatal(err)
- }
-
- for _, tile := range NewTiles(testH, i, i+1) {
- data, err := ReadTileData(tile, storage)
- if err != nil {
- t.Fatal(err)
- }
- old := Tile{H: tile.H, L: tile.L, N: tile.N, W: tile.W - 1}
- oldData := tiles[old]
- if len(oldData) != len(data)-HashSize || !bytes.Equal(oldData, data[:len(oldData)]) {
- t.Fatalf("tile %v not extending earlier tile %v", tile.Path(), old.Path())
- }
- tiles[tile] = data
- }
- for _, tile := range NewTiles(testH, 0, i+1) {
- data, err := ReadTileData(tile, storage)
- if err != nil {
- t.Fatal(err)
- }
- if !bytes.Equal(tiles[tile], data) {
- t.Fatalf("mismatch at %+v", tile)
- }
- }
- for _, tile := range NewTiles(testH, i/2, i+1) {
- data, err := ReadTileData(tile, storage)
- if err != nil {
- t.Fatal(err)
- }
- if !bytes.Equal(tiles[tile], data) {
- t.Fatalf("mismatch at %+v", tile)
- }
- }
-
- // Check that all the new hashes are readable from their tiles.
- for j := oldStorage; j < len(storage); j++ {
- tile := TileForIndex(testH, int64(j))
- data, ok := tiles[tile]
- if !ok {
- t.Log(NewTiles(testH, 0, i+1))
- t.Fatalf("TileForIndex(%d, %d) = %v, not yet stored (i=%d, stored %d)", testH, j, tile.Path(), i, len(storage))
- continue
- }
- h, err := HashFromTile(tile, data, int64(j))
- if err != nil {
- t.Fatal(err)
- }
- if h != storage[j] {
- t.Errorf("HashFromTile(%v, %d) = %v, want %v", tile.Path(), int64(j), h, storage[j])
- }
- }
-
- trees = append(trees, th)
-
- // Check that leaf proofs work, for all trees and leaves so far.
- for j := int64(0); j <= i; j++ {
- p, err := ProveRecord(i+1, j, storage)
- if err != nil {
- t.Fatalf("ProveRecord(%d, %d): %v", i+1, j, err)
- }
- if err := CheckRecord(p, i+1, th, j, leafhashes[j]); err != nil {
- t.Fatalf("CheckRecord(%d, %d): %v", i+1, j, err)
- }
- for k := range p {
- p[k][0] ^= 1
- if err := CheckRecord(p, i+1, th, j, leafhashes[j]); err == nil {
- t.Fatalf("CheckRecord(%d, %d) succeeded with corrupt proof hash #%d!", i+1, j, k)
- }
- p[k][0] ^= 1
- }
- }
-
- // Check that leaf proofs work using TileReader.
- // To prove a leaf that way, all you have to do is read and verify its hash.
- storage := &testTilesStorage{m: tiles}
- thr := TileHashReader(Tree{i + 1, th}, storage)
- for j := int64(0); j <= i; j++ {
- h, err := thr.ReadHashes([]int64{StoredHashIndex(0, j)})
- if err != nil {
- t.Fatalf("TileHashReader(%d).ReadHashes(%d): %v", i+1, j, err)
- }
- if h[0] != leafhashes[j] {
- t.Fatalf("TileHashReader(%d).ReadHashes(%d) returned wrong hash", i+1, j)
- }
-
- // Even though reading the hash suffices,
- // check we can generate the proof too.
- p, err := ProveRecord(i+1, j, thr)
- if err != nil {
- t.Fatalf("ProveRecord(%d, %d, TileHashReader(%d)): %v", i+1, j, i+1, err)
- }
- if err := CheckRecord(p, i+1, th, j, leafhashes[j]); err != nil {
- t.Fatalf("CheckRecord(%d, %d, TileHashReader(%d)): %v", i+1, j, i+1, err)
- }
- }
- if storage.unsaved != 0 {
- t.Fatalf("TileHashReader(%d) did not save %d tiles", i+1, storage.unsaved)
- }
-
- // Check that ReadHashes will give an error if the index is not in the tree.
- if _, err := thr.ReadHashes([]int64{(i + 1) * 2}); err == nil {
- t.Fatalf("TileHashReader(%d).ReadHashes(%d) for index not in tree <nil>, want err", i, i+1)
- }
- if storage.unsaved != 0 {
- t.Fatalf("TileHashReader(%d) did not save %d tiles", i+1, storage.unsaved)
- }
-
- // Check that tree proofs work, for all trees so far, using TileReader.
- // To prove a tree that way, all you have to do is compute and verify its hash.
- for j := int64(0); j <= i; j++ {
- h, err := TreeHash(j+1, thr)
- if err != nil {
- t.Fatalf("TreeHash(%d, TileHashReader(%d)): %v", j, i+1, err)
- }
- if h != trees[j] {
- t.Fatalf("TreeHash(%d, TileHashReader(%d)) = %x, want %x (%v)", j, i+1, h[:], trees[j][:], trees[j])
- }
-
- // Even though computing the subtree hash suffices,
- // check that we can generate the proof too.
- p, err := ProveTree(i+1, j+1, thr)
- if err != nil {
- t.Fatalf("ProveTree(%d, %d): %v", i+1, j+1, err)
- }
- if err := CheckTree(p, i+1, th, j+1, trees[j]); err != nil {
- t.Fatalf("CheckTree(%d, %d): %v [%v]", i+1, j+1, err, p)
- }
- for k := range p {
- p[k][0] ^= 1
- if err := CheckTree(p, i+1, th, j+1, trees[j]); err == nil {
- t.Fatalf("CheckTree(%d, %d) succeeded with corrupt proof hash #%d!", i+1, j+1, k)
- }
- p[k][0] ^= 1
- }
- }
- if storage.unsaved != 0 {
- t.Fatalf("TileHashReader(%d) did not save %d tiles", i+1, storage.unsaved)
- }
- }
-}
-
-func TestSplitStoredHashIndex(t *testing.T) {
- for l := 0; l < 10; l++ {
- for n := int64(0); n < 100; n++ {
- x := StoredHashIndex(l, n)
- l1, n1 := SplitStoredHashIndex(x)
- if l1 != l || n1 != n {
- t.Fatalf("StoredHashIndex(%d, %d) = %d, but SplitStoredHashIndex(%d) = %d, %d", l, n, x, x, l1, n1)
- }
- }
- }
-}
-
-// TODO(rsc): Test invalid paths too, like "tile/3/5/123/456/078".
-var tilePaths = []struct {
- path string
- tile Tile
-}{
- {"tile/4/0/001", Tile{4, 0, 1, 16}},
- {"tile/4/0/001.p/5", Tile{4, 0, 1, 5}},
- {"tile/3/5/x123/x456/078", Tile{3, 5, 123456078, 8}},
- {"tile/3/5/x123/x456/078.p/2", Tile{3, 5, 123456078, 2}},
- {"tile/1/0/x003/x057/500", Tile{1, 0, 3057500, 2}},
- {"tile/3/5/123/456/078", Tile{}},
- {"tile/3/-1/123/456/078", Tile{}},
- {"tile/1/data/x003/x057/500", Tile{1, -1, 3057500, 2}},
-}
-
-func TestTilePath(t *testing.T) {
- for _, tt := range tilePaths {
- if tt.tile.H > 0 {
- p := tt.tile.Path()
- if p != tt.path {
- t.Errorf("%+v.Path() = %q, want %q", tt.tile, p, tt.path)
- }
- }
- tile, err := ParseTilePath(tt.path)
- if err != nil {
- if tt.tile.H == 0 {
- // Expected error.
- continue
- }
- t.Errorf("ParseTilePath(%q): %v", tt.path, err)
- } else if tile != tt.tile {
- if tt.tile.H == 0 {
- t.Errorf("ParseTilePath(%q): expected error, got %+v", tt.path, tt.tile)
- continue
- }
- t.Errorf("ParseTilePath(%q) = %+v, want %+v", tt.path, tile, tt.tile)
- }
- }
-}
diff --git a/libgo/go/cmd/go/internal/vet/vet.go b/libgo/go/cmd/go/internal/vet/vet.go
index 327b761c3cd..660a739fbbd 100644
--- a/libgo/go/cmd/go/internal/vet/vet.go
+++ b/libgo/go/cmd/go/internal/vet/vet.go
@@ -51,6 +51,7 @@ func runVet(cmd *base.Command, args []string) {
work.BuildInit()
work.VetFlags = vetFlags
+ work.VetExplicit = true
if vetTool != "" {
var err error
work.VetTool, err = filepath.Abs(vetTool)
diff --git a/libgo/go/cmd/go/internal/vet/vetflag.go b/libgo/go/cmd/go/internal/vet/vetflag.go
index cbe7f8ce08c..e3de48bbffa 100644
--- a/libgo/go/cmd/go/internal/vet/vetflag.go
+++ b/libgo/go/cmd/go/internal/vet/vetflag.go
@@ -114,7 +114,7 @@ func vetFlags(usage func(), args []string) (passToVet, packageNames []string) {
// Add build flags to vetFlagDefn.
var cmd base.Command
- work.AddBuildFlags(&cmd)
+ work.AddBuildFlags(&cmd, work.DefaultBuildFlags)
// This flag declaration is a placeholder:
// -vettool is actually parsed by the init function above.
cmd.Flag.StringVar(new(string), "vettool", "", "path to vet tool binary")
@@ -126,7 +126,8 @@ func vetFlags(usage func(), args []string) (passToVet, packageNames []string) {
})
// Process args.
- args = str.StringList(cmdflag.FindGOFLAGS(vetFlagDefn), args)
+ goflags := cmdflag.FindGOFLAGS(vetFlagDefn)
+ args = str.StringList(goflags, args)
for i := 0; i < len(args); i++ {
if !strings.HasPrefix(args[i], "-") {
return args[:i], args[i:]
@@ -139,6 +140,9 @@ func vetFlags(usage func(), args []string) (passToVet, packageNames []string) {
base.SetExitStatus(2)
base.Exit()
}
+ if i < len(goflags) {
+ f.Present = false // Not actually present on the command line.
+ }
if f.Value != nil {
if err := f.Value.Set(value); err != nil {
base.Fatalf("invalid flag argument for -%s: %v", f.Name, err)
diff --git a/libgo/go/cmd/go/internal/web/api.go b/libgo/go/cmd/go/internal/web/api.go
index cd0e19d3ffd..ad99eb2f8c3 100644
--- a/libgo/go/cmd/go/internal/web/api.go
+++ b/libgo/go/cmd/go/internal/web/api.go
@@ -10,12 +10,15 @@
package web
import (
+ "bytes"
"fmt"
"io"
"io/ioutil"
"net/url"
"os"
"strings"
+ "unicode"
+ "unicode/utf8"
)
// SecurityMode specifies whether a function should make network
@@ -34,9 +37,32 @@ type HTTPError struct {
URL string // redacted
Status string
StatusCode int
+ Err error // underlying error, if known
+ Detail string // limited to maxErrorDetailLines and maxErrorDetailBytes
}
+const (
+ maxErrorDetailLines = 8
+ maxErrorDetailBytes = maxErrorDetailLines * 81
+)
+
func (e *HTTPError) Error() string {
+ if e.Detail != "" {
+ detailSep := " "
+ if strings.ContainsRune(e.Detail, '\n') {
+ detailSep = "\n\t"
+ }
+ return fmt.Sprintf("reading %s: %v\n\tserver response:%s%s", e.URL, e.Status, detailSep, e.Detail)
+ }
+
+ if err := e.Err; err != nil {
+ if pErr, ok := e.Err.(*os.PathError); ok && strings.HasSuffix(e.URL, pErr.Path) {
+ // Remove the redundant copy of the path.
+ err = pErr.Err
+ }
+ return fmt.Sprintf("reading %s: %v", e.URL, err)
+ }
+
return fmt.Sprintf("reading %s: %v", e.URL, e.Status)
}
@@ -44,6 +70,10 @@ func (e *HTTPError) Is(target error) bool {
return target == os.ErrNotExist && (e.StatusCode == 404 || e.StatusCode == 410)
}
+func (e *HTTPError) Unwrap() error {
+ return e.Err
+}
+
// GetBytes returns the body of the requested resource, or an error if the
// response status was not http.StatusOK.
//
@@ -69,16 +99,69 @@ type Response struct {
Status string
StatusCode int
Header map[string][]string
- Body io.ReadCloser
+ Body io.ReadCloser // Either the original body or &errorDetail.
+
+ fileErr error
+ errorDetail errorDetailBuffer
}
// Err returns an *HTTPError corresponding to the response r.
-// It returns nil if the response r has StatusCode 200 or 0 (unset).
+// If the response r has StatusCode 200 or 0 (unset), Err returns nil.
+// Otherwise, Err may read from r.Body in order to extract relevant error detail.
func (r *Response) Err() error {
if r.StatusCode == 200 || r.StatusCode == 0 {
return nil
}
- return &HTTPError{URL: r.URL, Status: r.Status, StatusCode: r.StatusCode}
+
+ return &HTTPError{
+ URL: r.URL,
+ Status: r.Status,
+ StatusCode: r.StatusCode,
+ Err: r.fileErr,
+ Detail: r.formatErrorDetail(),
+ }
+}
+
+// formatErrorDetail converts r.errorDetail (a prefix of the output of r.Body)
+// into a short, tab-indented summary.
+func (r *Response) formatErrorDetail() string {
+ if r.Body != &r.errorDetail {
+ return "" // Error detail collection not enabled.
+ }
+
+ // Ensure that r.errorDetail has been populated.
+ _, _ = io.Copy(ioutil.Discard, r.Body)
+
+ s := r.errorDetail.buf.String()
+ if !utf8.ValidString(s) {
+ return "" // Don't try to recover non-UTF-8 error messages.
+ }
+ for _, r := range s {
+ if !unicode.IsGraphic(r) && !unicode.IsSpace(r) {
+ return "" // Don't let the server do any funny business with the user's terminal.
+ }
+ }
+
+ var detail strings.Builder
+ for i, line := range strings.Split(s, "\n") {
+ if strings.TrimSpace(line) == "" {
+ break // Stop at the first blank line.
+ }
+ if i > 0 {
+ detail.WriteString("\n\t")
+ }
+ if i >= maxErrorDetailLines {
+ detail.WriteString("[Truncated: too many lines.]")
+ break
+ }
+ if detail.Len()+len(line) > maxErrorDetailBytes {
+ detail.WriteString("[Truncated: too long.]")
+ break
+ }
+ detail.WriteString(line)
+ }
+
+ return detail.String()
}
// Get returns the body of the HTTP or HTTPS resource specified at the given URL.
@@ -131,3 +214,39 @@ func Join(u *url.URL, path string) *url.URL {
j.RawPath = strings.TrimSuffix(u.RawPath, "/") + "/" + strings.TrimPrefix(path, "/")
return &j
}
+
+// An errorDetailBuffer is an io.ReadCloser that copies up to
+// maxErrorDetailLines into a buffer for later inspection.
+type errorDetailBuffer struct {
+ r io.ReadCloser
+ buf strings.Builder
+ bufLines int
+}
+
+func (b *errorDetailBuffer) Close() error {
+ return b.r.Close()
+}
+
+func (b *errorDetailBuffer) Read(p []byte) (n int, err error) {
+ n, err = b.r.Read(p)
+
+ // Copy the first maxErrorDetailLines+1 lines into b.buf,
+ // discarding any further lines.
+ //
+ // Note that the read may begin or end in the middle of a UTF-8 character,
+ // so don't try to do anything fancy with characters that encode to larger
+ // than one byte.
+ if b.bufLines <= maxErrorDetailLines {
+ for _, line := range bytes.SplitAfterN(p[:n], []byte("\n"), maxErrorDetailLines-b.bufLines) {
+ b.buf.Write(line)
+ if len(line) > 0 && line[len(line)-1] == '\n' {
+ b.bufLines++
+ if b.bufLines > maxErrorDetailLines {
+ break
+ }
+ }
+ }
+ }
+
+ return n, err
+}
diff --git a/libgo/go/cmd/go/internal/web/file_test.go b/libgo/go/cmd/go/internal/web/file_test.go
index e31ad71d4d9..63394690453 100644
--- a/libgo/go/cmd/go/internal/web/file_test.go
+++ b/libgo/go/cmd/go/internal/web/file_test.go
@@ -19,6 +19,8 @@ func TestGetFileURL(t *testing.T) {
if err != nil {
t.Fatal(err)
}
+ defer os.Remove(f.Name())
+
if _, err := f.WriteString(content); err != nil {
t.Error(err)
}
diff --git a/libgo/go/cmd/go/internal/web/http.go b/libgo/go/cmd/go/internal/web/http.go
index b790fe9916e..5e4319b00e9 100644
--- a/libgo/go/cmd/go/internal/web/http.go
+++ b/libgo/go/cmd/go/internal/web/http.go
@@ -14,7 +14,7 @@ package web
import (
"crypto/tls"
"fmt"
- "io/ioutil"
+ "mime"
"net/http"
urlpkg "net/url"
"os"
@@ -64,7 +64,7 @@ func get(security SecurityMode, url *urlpkg.URL) (*Response, error) {
Status: "404 testing",
StatusCode: 404,
Header: make(map[string][]string),
- Body: ioutil.NopCloser(strings.NewReader("")),
+ Body: http.NoBody,
}
if cfg.BuildX {
fmt.Fprintf(os.Stderr, "# get %s: %v (%.3fs)\n", Redacted(url), res.Status, time.Since(start).Seconds())
@@ -111,7 +111,7 @@ func get(security SecurityMode, url *urlpkg.URL) (*Response, error) {
fetched, res, err = fetch(secure)
if err != nil {
if cfg.BuildX {
- fmt.Fprintf(os.Stderr, "# get %s: %v\n", Redacted(url), err)
+ fmt.Fprintf(os.Stderr, "# get %s: %v\n", Redacted(secure), err)
}
if security != Insecure || url.Scheme == "https" {
// HTTPS failed, and we can't fall back to plain HTTP.
@@ -146,7 +146,7 @@ func get(security SecurityMode, url *urlpkg.URL) (*Response, error) {
insecure.Scheme = "http"
if insecure.User != nil && security != Insecure {
if cfg.BuildX {
- fmt.Fprintf(os.Stderr, "# get %s: insecure credentials\n", Redacted(url))
+ fmt.Fprintf(os.Stderr, "# get %s: insecure credentials\n", Redacted(insecure))
}
return nil, fmt.Errorf("refusing to pass credentials to insecure URL: %s", Redacted(insecure))
}
@@ -154,7 +154,7 @@ func get(security SecurityMode, url *urlpkg.URL) (*Response, error) {
fetched, res, err = fetch(insecure)
if err != nil {
if cfg.BuildX {
- fmt.Fprintf(os.Stderr, "# get %s: %v\n", Redacted(url), err)
+ fmt.Fprintf(os.Stderr, "# get %s: %v\n", Redacted(insecure), err)
}
// HTTP failed, and we already tried HTTPS if applicable.
// Report the error from the HTTP attempt.
@@ -165,8 +165,9 @@ func get(security SecurityMode, url *urlpkg.URL) (*Response, error) {
// Note: accepting a non-200 OK here, so people can serve a
// meta import in their http 404 page.
if cfg.BuildX {
- fmt.Fprintf(os.Stderr, "# get %s: %v (%.3fs)\n", Redacted(url), res.Status, time.Since(start).Seconds())
+ fmt.Fprintf(os.Stderr, "# get %s: %v (%.3fs)\n", Redacted(fetched), res.Status, time.Since(start).Seconds())
}
+
r := &Response{
URL: Redacted(fetched),
Status: res.Status,
@@ -174,6 +175,20 @@ func get(security SecurityMode, url *urlpkg.URL) (*Response, error) {
Header: map[string][]string(res.Header),
Body: res.Body,
}
+
+ if res.StatusCode != http.StatusOK {
+ contentType := res.Header.Get("Content-Type")
+ if mediaType, params, _ := mime.ParseMediaType(contentType); mediaType == "text/plain" {
+ switch charset := strings.ToLower(params["charset"]); charset {
+ case "us-ascii", "utf-8", "":
+ // Body claims to be plain text in UTF-8 or a subset thereof.
+ // Try to extract a useful error message from it.
+ r.errorDetail.r = res.Body
+ r.Body = &r.errorDetail
+ }
+ }
+ }
+
return r, nil
}
@@ -190,6 +205,7 @@ func getFile(u *urlpkg.URL) (*Response, error) {
Status: http.StatusText(http.StatusNotFound),
StatusCode: http.StatusNotFound,
Body: http.NoBody,
+ fileErr: err,
}, nil
}
@@ -199,6 +215,7 @@ func getFile(u *urlpkg.URL) (*Response, error) {
Status: http.StatusText(http.StatusForbidden),
StatusCode: http.StatusForbidden,
Body: http.NoBody,
+ fileErr: err,
}, nil
}
diff --git a/libgo/go/cmd/go/internal/web/url_other.go b/libgo/go/cmd/go/internal/web/url_other.go
index bd243e591a9..2641ee62bfa 100644
--- a/libgo/go/cmd/go/internal/web/url_other.go
+++ b/libgo/go/cmd/go/internal/web/url_other.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//+build !windows
+// +build !windows
package web
diff --git a/libgo/go/cmd/go/internal/web/url_other_test.go b/libgo/go/cmd/go/internal/web/url_other_test.go
index b4a74d94b93..aa5663355ef 100644
--- a/libgo/go/cmd/go/internal/web/url_other_test.go
+++ b/libgo/go/cmd/go/internal/web/url_other_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//+build !windows
+// +build !windows
package web
diff --git a/libgo/go/cmd/go/internal/work/action.go b/libgo/go/cmd/go/internal/work/action.go
index eabac6bd14e..db422fd9935 100644
--- a/libgo/go/cmd/go/internal/work/action.go
+++ b/libgo/go/cmd/go/internal/work/action.go
@@ -291,11 +291,12 @@ func (b *Builder) Init() {
}
}
- if _, ok := cfg.OSArchSupportsCgo[cfg.Goos+"/"+cfg.Goarch]; !ok && cfg.BuildContext.Compiler == "gc" {
- fmt.Fprintf(os.Stderr, "cmd/go: unsupported GOOS/GOARCH pair %s/%s\n", cfg.Goos, cfg.Goarch)
+ if err := CheckGOOSARCHPair(cfg.Goos, cfg.Goarch); err != nil {
+ fmt.Fprintf(os.Stderr, "cmd/go: %v\n", err)
base.SetExitStatus(2)
base.Exit()
}
+
for _, tag := range cfg.BuildContext.BuildTags {
if strings.Contains(tag, ",") {
fmt.Fprintf(os.Stderr, "cmd/go: -tags space-separated list contains comma\n")
@@ -305,6 +306,13 @@ func (b *Builder) Init() {
}
}
+func CheckGOOSARCHPair(goos, goarch string) error {
+ if _, ok := cfg.OSArchSupportsCgo[goos+"/"+goarch]; !ok && cfg.BuildContext.Compiler == "gc" {
+ return fmt.Errorf("unsupported GOOS/GOARCH pair %s/%s", goos, goarch)
+ }
+ return nil
+}
+
// NewObjdir returns the name of a fresh object directory under b.WorkDir.
// It is up to the caller to call b.Mkdir on the result at an appropriate time.
// The result ends in a slash, so that file names in that directory
@@ -707,7 +715,7 @@ func (b *Builder) addInstallHeaderAction(a *Action) {
}
// buildmodeShared takes the "go build" action a1 into the building of a shared library of a1.Deps.
-// That is, the input a1 represents "go build pkgs" and the result represents "go build -buidmode=shared pkgs".
+// That is, the input a1 represents "go build pkgs" and the result represents "go build -buildmode=shared pkgs".
func (b *Builder) buildmodeShared(mode, depMode BuildMode, args []string, pkgs []*load.Package, a1 *Action) *Action {
name, err := libname(args, pkgs)
if err != nil {
diff --git a/libgo/go/cmd/go/internal/work/build.go b/libgo/go/cmd/go/internal/work/build.go
index 9305b2d859c..e3b25c937c3 100644
--- a/libgo/go/cmd/go/internal/work/build.go
+++ b/libgo/go/cmd/go/internal/work/build.go
@@ -62,11 +62,13 @@ and test commands:
The default is the number of CPUs available.
-race
enable data race detection.
- Supported only on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64.
+ Supported only on linux/amd64, freebsd/amd64, darwin/amd64, windows/amd64,
+ linux/ppc64le and linux/arm64 (only for 48-bit VMA).
-msan
enable interoperation with memory sanitizer.
Supported only on linux/amd64, linux/arm64
and only with Clang/LLVM as the host C compiler.
+ On linux/arm64, pie build mode will be used.
-v
print the names of packages as they are compiled.
-work
@@ -95,11 +97,21 @@ and test commands:
-ldflags '[pattern=]arg list'
arguments to pass on each go tool link invocation.
-linkshared
- link against shared libraries previously created with
- -buildmode=shared.
+ build code that will be linked against shared libraries previously
+ created with -buildmode=shared.
-mod mode
- module download mode to use: readonly or vendor.
+ module download mode to use: readonly, vendor, or mod.
See 'go help modules' for more.
+ -modcacherw
+ leave newly-created directories in the module cache read-write
+ instead of making them read-only.
+ -modfile file
+ in module aware mode, read (and possibly write) an alternate go.mod
+ file instead of the one in the module root directory. A file named
+ "go.mod" must still be present in order to determine the module root
+ directory, but it is not accessed. When -modfile is specified, an
+ alternate go.sum file is also used: its path is derived from the
+ -modfile flag by trimming the ".mod" extension and appending ".sum".
-pkgdir dir
install and load all packages from dir instead of the usual locations.
For example, when building with a non-standard configuration,
@@ -165,8 +177,8 @@ func init() {
CmdInstall.Flag.BoolVar(&cfg.BuildI, "i", false, "")
- AddBuildFlags(CmdBuild)
- AddBuildFlags(CmdInstall)
+ AddBuildFlags(CmdBuild, DefaultBuildFlags)
+ AddBuildFlags(CmdInstall, DefaultBuildFlags)
}
// Note that flags consulted by other parts of the code
@@ -214,9 +226,17 @@ func init() {
}
}
-// addBuildFlags adds the flags common to the build, clean, get,
+type BuildFlagMask int
+
+const (
+ DefaultBuildFlags BuildFlagMask = 0
+ OmitModFlag BuildFlagMask = 1 << iota
+ OmitModCommonFlags
+)
+
+// AddBuildFlags adds the flags common to the build, clean, get,
// install, list, run, and test commands.
-func AddBuildFlags(cmd *base.Command) {
+func AddBuildFlags(cmd *base.Command, mask BuildFlagMask) {
cmd.Flag.BoolVar(&cfg.BuildA, "a", false, "")
cmd.Flag.BoolVar(&cfg.BuildN, "n", false, "")
cmd.Flag.IntVar(&cfg.BuildP, "p", cfg.BuildP, "")
@@ -228,7 +248,12 @@ func AddBuildFlags(cmd *base.Command) {
cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "")
cmd.Flag.Var(&load.BuildGcflags, "gcflags", "")
cmd.Flag.Var(&load.BuildGccgoflags, "gccgoflags", "")
- cmd.Flag.StringVar(&cfg.BuildMod, "mod", "", "")
+ if mask&OmitModFlag == 0 {
+ cmd.Flag.StringVar(&cfg.BuildMod, "mod", "", "")
+ }
+ if mask&OmitModCommonFlags == 0 {
+ AddModCommonFlags(cmd)
+ }
cmd.Flag.StringVar(&cfg.BuildContext.InstallSuffix, "installsuffix", "", "")
cmd.Flag.Var(&load.BuildLdflags, "ldflags", "")
cmd.Flag.BoolVar(&cfg.BuildLinkshared, "linkshared", false, "")
@@ -244,6 +269,13 @@ func AddBuildFlags(cmd *base.Command) {
cmd.Flag.StringVar(&cfg.DebugActiongraph, "debug-actiongraph", "", "")
}
+// AddModCommonFlags adds the module-related flags common to build commands
+// and 'go mod' subcommands.
+func AddModCommonFlags(cmd *base.Command) {
+ cmd.Flag.BoolVar(&cfg.ModCacheRW, "modcacherw", false, "")
+ cmd.Flag.StringVar(&cfg.ModFile, "modfile", "", "")
+}
+
// tagsFlag is the implementation of the -tags flag.
type tagsFlag []string
@@ -318,7 +350,7 @@ func runBuild(cmd *base.Command, args []string) {
explicitO := len(cfg.BuildO) > 0
if len(pkgs) == 1 && pkgs[0].Name == "main" && cfg.BuildO == "" {
- cfg.BuildO = load.DefaultExecName(pkgs[0].ImportPath)
+ cfg.BuildO = pkgs[0].DefaultExecName()
cfg.BuildO += cfg.ExeSuffix
}
@@ -362,7 +394,8 @@ func runBuild(cmd *base.Command, args []string) {
if p.Name != "main" {
continue
}
- p.Target = filepath.Join(cfg.BuildO, load.DefaultExecName(p.ImportPath))
+
+ p.Target = filepath.Join(cfg.BuildO, p.DefaultExecName())
p.Target += cfg.ExeSuffix
p.Stale = true
p.StaleReason = "build -o flag in use"
@@ -584,7 +617,7 @@ func InstallPackages(patterns []string, pkgs []*load.Package) {
if len(patterns) == 0 && len(pkgs) == 1 && pkgs[0].Name == "main" {
// Compute file 'go build' would have created.
// If it exists and is an executable file, remove it.
- targ := load.DefaultExecName(pkgs[0].ImportPath)
+ targ := pkgs[0].DefaultExecName()
targ += cfg.ExeSuffix
if filepath.Join(pkgs[0].Dir, targ) != pkgs[0].Target { // maybe $GOBIN is the current directory
fi, err := os.Stat(targ)
diff --git a/libgo/go/cmd/go/internal/work/build_test.go b/libgo/go/cmd/go/internal/work/build_test.go
index 55e1eea25ba..b60f4e27c04 100644
--- a/libgo/go/cmd/go/internal/work/build_test.go
+++ b/libgo/go/cmd/go/internal/work/build_test.go
@@ -221,8 +221,6 @@ func pkgImportPath(pkgpath string) *load.Package {
// See https://golang.org/issue/18878.
func TestRespectSetgidDir(t *testing.T) {
switch runtime.GOOS {
- case "nacl":
- t.Skip("can't set SetGID bit with chmod on nacl")
case "darwin":
if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
t.Skip("can't set SetGID bit with chmod on iOS")
diff --git a/libgo/go/cmd/go/internal/work/buildid.go b/libgo/go/cmd/go/internal/work/buildid.go
index 27bde8c6151..7558a3091aa 100644
--- a/libgo/go/cmd/go/internal/work/buildid.go
+++ b/libgo/go/cmd/go/internal/work/buildid.go
@@ -15,7 +15,6 @@ import (
"cmd/go/internal/base"
"cmd/go/internal/cache"
"cmd/go/internal/cfg"
- "cmd/go/internal/load"
"cmd/go/internal/str"
"cmd/internal/buildid"
)
@@ -421,7 +420,7 @@ func (b *Builder) fileHash(file string) string {
// during a's work. The caller should defer b.flushOutput(a), to make sure
// that flushOutput is eventually called regardless of whether the action
// succeeds. The flushOutput call must happen after updateBuildID.
-func (b *Builder) useCache(a *Action, p *load.Package, actionHash cache.ActionID, target string) bool {
+func (b *Builder) useCache(a *Action, actionHash cache.ActionID, target string) bool {
// The second half of the build ID here is a placeholder for the content hash.
// It's important that the overall buildID be unlikely verging on impossible
// to appear in the output by chance, but that should be taken care of by
diff --git a/libgo/go/cmd/go/internal/work/exec.go b/libgo/go/cmd/go/internal/work/exec.go
index c666026213b..ba81543fdf7 100644
--- a/libgo/go/cmd/go/internal/work/exec.go
+++ b/libgo/go/cmd/go/internal/work/exec.go
@@ -54,8 +54,9 @@ func actionList(root *Action) []*Action {
// do runs the action graph rooted at root.
func (b *Builder) Do(root *Action) {
- if c := cache.Default(); c != nil && !b.IsCmdList {
+ if !b.IsCmdList {
// If we're doing real work, take time at the end to trim the cache.
+ c := cache.Default()
defer c.Trim()
}
@@ -200,13 +201,17 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
// same compiler settings and can reuse each other's results.
// If not, the reason is already recorded in buildGcflags.
fmt.Fprintf(h, "compile\n")
+ // Only include the package directory if it may affect the output.
+ // We trim workspace paths for all packages when -trimpath is set.
// The compiler hides the exact value of $GOROOT
- // when building things in GOROOT,
- // but it does not hide the exact value of $GOPATH.
- // Include the full dir in that case.
+ // when building things in GOROOT.
// Assume b.WorkDir is being trimmed properly.
- if !p.Goroot && !strings.HasPrefix(p.Dir, b.WorkDir) {
+ // When -trimpath is used with a package built from the module cache,
+ // use the module path and version instead of the directory.
+ if !p.Goroot && !cfg.BuildTrimpath && !strings.HasPrefix(p.Dir, b.WorkDir) {
fmt.Fprintf(h, "dir %s\n", p.Dir)
+ } else if cfg.BuildTrimpath && p.Module != nil {
+ fmt.Fprintf(h, "module %s@%s\n", p.Module.Path, p.Module.Version)
}
fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch)
fmt.Fprintf(h, "import %q\n", p.ImportPath)
@@ -394,7 +399,7 @@ func (b *Builder) build(a *Action) (err error) {
bit(needCompiledGoFiles, b.NeedCompiledGoFiles)
if !p.BinaryOnly {
- if b.useCache(a, p, b.buildActionID(a), p.Target) {
+ if b.useCache(a, b.buildActionID(a), p.Target) {
// We found the main output in the cache.
// If we don't need any other outputs, we can stop.
// Otherwise, we need to write files to a.Objdir (needVet, needCgoHdr).
@@ -406,15 +411,19 @@ func (b *Builder) build(a *Action) (err error) {
if b.NeedExport {
p.Export = a.built
}
- if need&needCompiledGoFiles != 0 && b.loadCachedSrcFiles(a) {
- need &^= needCompiledGoFiles
+ if need&needCompiledGoFiles != 0 {
+ if err := b.loadCachedSrcFiles(a); err == nil {
+ need &^= needCompiledGoFiles
+ }
}
}
// Source files might be cached, even if the full action is not
// (e.g., go list -compiled -find).
- if !cachedBuild && need&needCompiledGoFiles != 0 && b.loadCachedSrcFiles(a) {
- need &^= needCompiledGoFiles
+ if !cachedBuild && need&needCompiledGoFiles != 0 {
+ if err := b.loadCachedSrcFiles(a); err == nil {
+ need &^= needCompiledGoFiles
+ }
}
if need == 0 {
@@ -428,7 +437,7 @@ func (b *Builder) build(a *Action) (err error) {
err = fmt.Errorf("go build %s: %v", a.Package.ImportPath, err)
}
if err != nil && b.IsCmdList && b.NeedError && p.Error == nil {
- p.Error = &load.PackageError{Err: err.Error()}
+ p.Error = &load.PackageError{Err: err}
}
}()
if cfg.BuildN {
@@ -459,16 +468,20 @@ func (b *Builder) build(a *Action) (err error) {
objdir := a.Objdir
// Load cached cgo header, but only if we're skipping the main build (cachedBuild==true).
- if cachedBuild && need&needCgoHdr != 0 && b.loadCachedCgoHdr(a) {
- need &^= needCgoHdr
+ if cachedBuild && need&needCgoHdr != 0 {
+ if err := b.loadCachedCgoHdr(a); err == nil {
+ need &^= needCgoHdr
+ }
}
// Load cached vet config, but only if that's all we have left
// (need == needVet, not testing just the one bit).
// If we are going to do a full build anyway,
// we're going to regenerate the files below anyway.
- if need == needVet && b.loadCachedVet(a) {
- need &^= needVet
+ if need == needVet {
+ if err := b.loadCachedVet(a); err == nil {
+ need &^= needVet
+ }
}
if need == 0 {
return nil
@@ -615,8 +628,8 @@ func (b *Builder) build(a *Action) (err error) {
need &^= needVet
}
if need&needCompiledGoFiles != 0 {
- if !b.loadCachedSrcFiles(a) {
- return fmt.Errorf("failed to cache compiled Go files")
+ if err := b.loadCachedSrcFiles(a); err != nil {
+ return fmt.Errorf("loading compiled Go files from cache: %w", err)
}
need &^= needCompiledGoFiles
}
@@ -656,7 +669,7 @@ func (b *Builder) build(a *Action) (err error) {
}
if p.Internal.BuildInfo != "" && cfg.ModulesEnabled {
- if err := b.writeFile(objdir+"_gomod_.go", load.ModInfoProg(p.Internal.BuildInfo)); err != nil {
+ if err := b.writeFile(objdir+"_gomod_.go", load.ModInfoProg(p.Internal.BuildInfo, cfg.BuildToolchainName == "gccgo")); err != nil {
return err
}
gofiles = append(gofiles, objdir+"_gomod_.go")
@@ -790,7 +803,7 @@ func (b *Builder) cacheObjdirFile(a *Action, c *cache.Cache, name string) error
func (b *Builder) findCachedObjdirFile(a *Action, c *cache.Cache, name string) (string, error) {
file, _, err := c.GetFile(cache.Subkey(a.actionID, name))
if err != nil {
- return "", err
+ return "", fmt.Errorf("loading cached file %s: %w", name, err)
}
return file, nil
}
@@ -805,26 +818,16 @@ func (b *Builder) loadCachedObjdirFile(a *Action, c *cache.Cache, name string) e
func (b *Builder) cacheCgoHdr(a *Action) {
c := cache.Default()
- if c == nil {
- return
- }
b.cacheObjdirFile(a, c, "_cgo_install.h")
}
-func (b *Builder) loadCachedCgoHdr(a *Action) bool {
+func (b *Builder) loadCachedCgoHdr(a *Action) error {
c := cache.Default()
- if c == nil {
- return false
- }
- err := b.loadCachedObjdirFile(a, c, "_cgo_install.h")
- return err == nil
+ return b.loadCachedObjdirFile(a, c, "_cgo_install.h")
}
func (b *Builder) cacheSrcFiles(a *Action, srcfiles []string) {
c := cache.Default()
- if c == nil {
- return
- }
var buf bytes.Buffer
for _, file := range srcfiles {
if !strings.HasPrefix(file, a.Objdir) {
@@ -844,14 +847,11 @@ func (b *Builder) cacheSrcFiles(a *Action, srcfiles []string) {
c.PutBytes(cache.Subkey(a.actionID, "srcfiles"), buf.Bytes())
}
-func (b *Builder) loadCachedVet(a *Action) bool {
+func (b *Builder) loadCachedVet(a *Action) error {
c := cache.Default()
- if c == nil {
- return false
- }
list, _, err := c.GetBytes(cache.Subkey(a.actionID, "srcfiles"))
if err != nil {
- return false
+ return fmt.Errorf("reading srcfiles list: %w", err)
}
var srcfiles []string
for _, name := range strings.Split(string(list), "\n") {
@@ -863,22 +863,19 @@ func (b *Builder) loadCachedVet(a *Action) bool {
continue
}
if err := b.loadCachedObjdirFile(a, c, name); err != nil {
- return false
+ return err
}
srcfiles = append(srcfiles, a.Objdir+name)
}
buildVetConfig(a, srcfiles)
- return true
+ return nil
}
-func (b *Builder) loadCachedSrcFiles(a *Action) bool {
+func (b *Builder) loadCachedSrcFiles(a *Action) error {
c := cache.Default()
- if c == nil {
- return false
- }
list, _, err := c.GetBytes(cache.Subkey(a.actionID, "srcfiles"))
if err != nil {
- return false
+ return fmt.Errorf("reading srcfiles list: %w", err)
}
var files []string
for _, name := range strings.Split(string(list), "\n") {
@@ -891,12 +888,12 @@ func (b *Builder) loadCachedSrcFiles(a *Action) bool {
}
file, err := b.findCachedObjdirFile(a, c, name)
if err != nil {
- return false
+ return fmt.Errorf("finding %s: %w", name, err)
}
files = append(files, file)
}
a.Package.CompiledGoFiles = files
- return true
+ return nil
}
// vetConfig is the configuration passed to vet describing a single package.
@@ -1032,7 +1029,7 @@ func (b *Builder) vet(a *Action) error {
// dependency tree turn on *more* analysis, as here.
// (The unsafeptr check does not write any facts for use by
// later vet runs.)
- if a.Package.Goroot && !VetExplicit {
+ if a.Package.Goroot && !VetExplicit && VetTool == "" {
// Note that $GOROOT/src/buildall.bash
// does the same for the misc-compile trybots
// and should be updated if these flags are
@@ -1060,12 +1057,11 @@ func (b *Builder) vet(a *Action) error {
}
key := cache.ActionID(h.Sum())
- if vcfg.VetxOnly {
- if c := cache.Default(); c != nil && !cfg.BuildA {
- if file, _, err := c.GetFile(key); err == nil {
- a.built = file
- return nil
- }
+ if vcfg.VetxOnly && !cfg.BuildA {
+ c := cache.Default()
+ if file, _, err := c.GetFile(key); err == nil {
+ a.built = file
+ return nil
}
}
@@ -1093,9 +1089,7 @@ func (b *Builder) vet(a *Action) error {
// If vet wrote export data, save it for input to future vets.
if f, err := os.Open(vcfg.VetxOutput); err == nil {
a.built = vcfg.VetxOutput
- if c := cache.Default(); c != nil {
- c.Put(key, f)
- }
+ cache.Default().Put(key, f)
f.Close()
}
@@ -1183,7 +1177,7 @@ func (b *Builder) printLinkerConfig(h io.Writer, p *load.Package) {
// link is the action for linking a single command.
// Note that any new influence on this logic must be reported in b.linkActionID above as well.
func (b *Builder) link(a *Action) (err error) {
- if b.useCache(a, a.Package, b.linkActionID(a), a.Package.Target) || b.IsCmdList {
+ if b.useCache(a, b.linkActionID(a), a.Package.Target) || b.IsCmdList {
return nil
}
defer b.flushOutput(a)
@@ -1416,7 +1410,7 @@ func (b *Builder) linkSharedActionID(a *Action) cache.ActionID {
}
func (b *Builder) linkShared(a *Action) (err error) {
- if b.useCache(a, nil, b.linkSharedActionID(a), a.Target) || b.IsCmdList {
+ if b.useCache(a, b.linkSharedActionID(a), a.Target) || b.IsCmdList {
return nil
}
defer b.flushOutput(a)
@@ -1622,12 +1616,12 @@ func (b *Builder) copyFile(dst, src string, perm os.FileMode, force bool) error
// Be careful about removing/overwriting dst.
// Do not remove/overwrite if dst exists and is a directory
- // or a non-object file.
+ // or a non-empty non-object file.
if fi, err := os.Stat(dst); err == nil {
if fi.IsDir() {
return fmt.Errorf("build output %q already exists and is a directory", dst)
}
- if !force && fi.Mode().IsRegular() && !isObject(dst) {
+ if !force && fi.Mode().IsRegular() && fi.Size() != 0 && !isObject(dst) {
return fmt.Errorf("build output %q already exists and is not an object file", dst)
}
}
@@ -1652,7 +1646,7 @@ func (b *Builder) copyFile(dst, src string, perm os.FileMode, force bool) error
df, err = os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm)
}
if err != nil {
- return err
+ return fmt.Errorf("copying %s: %w", src, err) // err should already refer to dst
}
_, err = io.Copy(df, sf)
@@ -1782,6 +1776,11 @@ func (b *Builder) fmtcmd(dir string, format string, args ...interface{}) string
}
if b.WorkDir != "" {
cmd = strings.ReplaceAll(cmd, b.WorkDir, "$WORK")
+ escaped := strconv.Quote(b.WorkDir)
+ escaped = escaped[1 : len(escaped)-1] // strip quote characters
+ if escaped != b.WorkDir {
+ cmd = strings.ReplaceAll(cmd, escaped, "$WORK")
+ }
}
return cmd
}
@@ -2408,7 +2407,7 @@ func (b *Builder) gccArchArgs() []string {
switch cfg.Goarch {
case "386":
return []string{"-m32"}
- case "amd64", "amd64p32":
+ case "amd64":
return []string{"-m64"}
case "arm":
return []string{"-marm"} // not thumb
diff --git a/libgo/go/cmd/go/internal/work/gc.go b/libgo/go/cmd/go/internal/work/gc.go
index 86322946a61..57024694cf6 100644
--- a/libgo/go/cmd/go/internal/work/gc.go
+++ b/libgo/go/cmd/go/internal/work/gc.go
@@ -92,8 +92,7 @@ func (gcToolchain) gc(b *Builder, a *Action, archive string, importcfg []byte, s
if a.buildID != "" {
gcargs = append(gcargs, "-buildid", a.buildID)
}
- platform := cfg.Goos + "/" + cfg.Goarch
- if p.Internal.OmitDebug || platform == "nacl/amd64p32" || cfg.Goos == "plan9" || cfg.Goarch == "wasm" {
+ if p.Internal.OmitDebug || cfg.Goos == "plan9" || cfg.Goarch == "wasm" {
gcargs = append(gcargs, "-dwarf=false")
}
if strings.HasPrefix(runtimeVersion, "go1") && !strings.Contains(os.Args[0], "go_bootstrap") {
diff --git a/libgo/go/cmd/go/internal/work/gccgo.go b/libgo/go/cmd/go/internal/work/gccgo.go
index 87b3f5facd9..f6fa17da85c 100644
--- a/libgo/go/cmd/go/internal/work/gccgo.go
+++ b/libgo/go/cmd/go/internal/work/gccgo.go
@@ -91,6 +91,10 @@ func (tools gccgoToolchain) gc(b *Builder, a *Action, archive string, importcfg
args = append(args, "-I", root)
}
}
+ if cfg.BuildTrimpath && b.gccSupportsFlag(args[:1], "-ffile-prefix-map=a=b") {
+ args = append(args, "-ffile-prefix-map="+base.Cwd+"=.")
+ args = append(args, "-ffile-prefix-map="+b.WorkDir+"=/tmp/go-build")
+ }
args = append(args, a.Package.Internal.Gccgoflags...)
for _, f := range gofiles {
args = append(args, mkAbs(p.Dir, f))
@@ -354,7 +358,7 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string
}
if haveShlib[filepath.Base(a.Target)] {
- // This is a shared library we want to link againt.
+ // This is a shared library we want to link against.
if !addedShlib[a.Target] {
shlibs = append(shlibs, a.Target)
addedShlib[a.Target] = true
@@ -560,7 +564,10 @@ func (tools gccgoToolchain) cc(b *Builder, a *Action, ofile, cfile string) error
defs = append(defs, "-fsplit-stack")
}
defs = tools.maybePIC(defs)
- if b.gccSupportsFlag(compiler, "-fdebug-prefix-map=a=b") {
+ if b.gccSupportsFlag(compiler, "-ffile-prefix-map=a=b") {
+ defs = append(defs, "-ffile-prefix-map="+base.Cwd+"=.")
+ defs = append(defs, "-ffile-prefix-map="+b.WorkDir+"=/tmp/go-build")
+ } else if b.gccSupportsFlag(compiler, "-fdebug-prefix-map=a=b") {
defs = append(defs, "-fdebug-prefix-map="+b.WorkDir+"=/tmp/go-build")
}
if b.gccSupportsFlag(compiler, "-gno-record-gcc-switches") {
diff --git a/libgo/go/cmd/go/internal/work/init.go b/libgo/go/cmd/go/internal/work/init.go
index 35d3a505cc7..9091f986368 100644
--- a/libgo/go/cmd/go/internal/work/init.go
+++ b/libgo/go/cmd/go/internal/work/init.go
@@ -60,6 +60,11 @@ func instrumentInit() {
mode := "race"
if cfg.BuildMSan {
mode = "msan"
+ // MSAN does not support non-PIE binaries on ARM64.
+ // See issue #33712 for details.
+ if cfg.Goos == "linux" && cfg.Goarch == "arm64" && cfg.BuildBuildmode == "default" {
+ cfg.BuildBuildmode = "pie"
+ }
}
modeFlag := "-" + mode
@@ -81,7 +86,11 @@ func instrumentInit() {
func buildModeInit() {
gccgo := cfg.BuildToolchainName == "gccgo"
var codegenArg string
- platform := cfg.Goos + "/" + cfg.Goarch
+
+ // Configure the build mode first, then verify that it is supported.
+ // That way, if the flag is completely bogus we will prefer to error out with
+ // "-buildmode=%s not supported" instead of naming the specific platform.
+
switch cfg.BuildBuildmode {
case "archive":
pkgsFilter = pkgsNotMain
@@ -90,20 +99,18 @@ func buildModeInit() {
if gccgo {
codegenArg = "-fPIC"
} else {
- switch platform {
- case "darwin/arm", "darwin/arm64":
- codegenArg = "-shared"
- default:
- switch cfg.Goos {
- case "dragonfly", "freebsd", "illumos", "linux", "netbsd", "openbsd", "solaris":
- if platform == "linux/ppc64" {
- base.Fatalf("-buildmode=c-archive not supported on %s\n", platform)
- }
- // Use -shared so that the result is
- // suitable for inclusion in a PIE or
- // shared library.
+ switch cfg.Goos {
+ case "darwin":
+ switch cfg.Goarch {
+ case "arm", "arm64":
codegenArg = "-shared"
}
+
+ case "dragonfly", "freebsd", "illumos", "linux", "netbsd", "openbsd", "solaris":
+ // Use -shared so that the result is
+ // suitable for inclusion in a PIE or
+ // shared library.
+ codegenArg = "-shared"
}
}
cfg.ExeSuffix = ".a"
@@ -113,27 +120,25 @@ func buildModeInit() {
if gccgo {
codegenArg = "-fPIC"
} else {
- switch platform {
- case "linux/amd64", "linux/arm", "linux/arm64", "linux/386", "linux/ppc64le", "linux/s390x",
- "android/amd64", "android/arm", "android/arm64", "android/386",
- "freebsd/amd64":
+ switch cfg.Goos {
+ case "linux", "android", "freebsd":
codegenArg = "-shared"
- case "darwin/amd64", "darwin/386":
- case "windows/amd64", "windows/386":
+ case "windows":
// Do not add usual .exe suffix to the .dll file.
cfg.ExeSuffix = ""
- default:
- base.Fatalf("-buildmode=c-shared not supported on %s\n", platform)
}
}
ldBuildmode = "c-shared"
case "default":
- switch platform {
- case "android/arm", "android/arm64", "android/amd64", "android/386":
+ switch cfg.Goos {
+ case "android":
codegenArg = "-shared"
ldBuildmode = "pie"
- case "darwin/arm", "darwin/arm64":
- codegenArg = "-shared"
+ case "darwin":
+ switch cfg.Goarch {
+ case "arm", "arm64":
+ codegenArg = "-shared"
+ }
fallthrough
default:
ldBuildmode = "exe"
@@ -156,18 +161,8 @@ func buildModeInit() {
}
if gccgo {
codegenArg = "-fPIE"
- } else {
- switch platform {
- case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x",
- "android/amd64", "android/arm", "android/arm64", "android/386",
- "freebsd/amd64":
- codegenArg = "-shared"
- case "darwin/amd64":
- codegenArg = "-shared"
- case "aix/ppc64":
- default:
- base.Fatalf("-buildmode=pie not supported on %s\n", platform)
- }
+ } else if cfg.Goos != "aix" {
+ codegenArg = "-shared"
}
ldBuildmode = "pie"
case "shared":
@@ -175,11 +170,6 @@ func buildModeInit() {
if gccgo {
codegenArg = "-fPIC"
} else {
- switch platform {
- case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x":
- default:
- base.Fatalf("-buildmode=shared not supported on %s\n", platform)
- }
codegenArg = "-dynlink"
}
if cfg.BuildO != "" {
@@ -191,15 +181,6 @@ func buildModeInit() {
if gccgo {
codegenArg = "-fPIC"
} else {
- switch platform {
- case "linux/amd64", "linux/arm", "linux/arm64", "linux/386", "linux/s390x", "linux/ppc64le",
- "android/amd64", "android/arm", "android/arm64", "android/386":
- case "darwin/amd64":
- // Skip DWARF generation due to #21647
- forcedLdflags = append(forcedLdflags, "-w")
- default:
- base.Fatalf("-buildmode=plugin not supported on %s\n", platform)
- }
codegenArg = "-dynlink"
}
cfg.ExeSuffix = ".so"
@@ -207,17 +188,21 @@ func buildModeInit() {
default:
base.Fatalf("buildmode=%s not supported", cfg.BuildBuildmode)
}
+
+ if !sys.BuildModeSupported(cfg.BuildToolchainName, cfg.BuildBuildmode, cfg.Goos, cfg.Goarch) {
+ base.Fatalf("-buildmode=%s not supported on %s/%s\n", cfg.BuildBuildmode, cfg.Goos, cfg.Goarch)
+ }
+
if cfg.BuildLinkshared {
+ if !sys.BuildModeSupported(cfg.BuildToolchainName, "shared", cfg.Goos, cfg.Goarch) {
+ base.Fatalf("-linkshared not supported on %s/%s\n", cfg.Goos, cfg.Goarch)
+ }
if gccgo {
codegenArg = "-fPIC"
} else {
- switch platform {
- case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x":
- forcedAsmflags = append(forcedAsmflags, "-D=GOBUILDMODE_shared=1")
- default:
- base.Fatalf("-linkshared not supported on %s\n", platform)
- }
+ forcedAsmflags = append(forcedAsmflags, "-D=GOBUILDMODE_shared=1")
codegenArg = "-dynlink"
+ forcedGcflags = append(forcedGcflags, "-linkshared")
// TODO(mwhudson): remove -w when that gets fixed in linker.
forcedLdflags = append(forcedLdflags, "-linkshared", "-w")
}
@@ -241,12 +226,20 @@ func buildModeInit() {
switch cfg.BuildMod {
case "":
// ok
- case "readonly", "vendor":
- if load.ModLookup == nil && !inGOFLAGS("-mod") {
+ case "readonly", "vendor", "mod":
+ if !cfg.ModulesEnabled && !inGOFLAGS("-mod") {
base.Fatalf("build flag -mod=%s only valid when using modules", cfg.BuildMod)
}
default:
- base.Fatalf("-mod=%s not supported (can be '', 'readonly', or 'vendor')", cfg.BuildMod)
+ base.Fatalf("-mod=%s not supported (can be '', 'mod', 'readonly', or 'vendor')", cfg.BuildMod)
+ }
+ if !cfg.ModulesEnabled {
+ if cfg.ModCacheRW && !inGOFLAGS("-modcacherw") {
+ base.Fatalf("build flag -modcacherw only valid when using modules")
+ }
+ if cfg.ModFile != "" && !inGOFLAGS("-mod") {
+ base.Fatalf("build flag -modfile only valid when using modules")
+ }
}
}
diff --git a/libgo/go/cmd/go/internal/work/security.go b/libgo/go/cmd/go/internal/work/security.go
index 0d8da21ae38..0ce1664c16f 100644
--- a/libgo/go/cmd/go/internal/work/security.go
+++ b/libgo/go/cmd/go/internal/work/security.go
@@ -43,6 +43,7 @@ var re = lazyregexp.New
var validCompilerFlags = []*lazyregexp.Regexp{
re(`-D([A-Za-z_].*)`),
+ re(`-U([A-Za-z_]*)`),
re(`-F([^@\-].*)`),
re(`-I([^@\-].*)`),
re(`-O`),
@@ -51,6 +52,7 @@ var validCompilerFlags = []*lazyregexp.Regexp{
re(`-W([^@,]+)`), // -Wall but not -Wa,-foo.
re(`-Wa,-mbig-obj`),
re(`-Wp,-D([A-Za-z_].*)`),
+ re(`-Wp,-U([A-Za-z_]*)`),
re(`-ansi`),
re(`-f(no-)?asynchronous-unwind-tables`),
re(`-f(no-)?blocks`),
@@ -127,6 +129,7 @@ var validCompilerFlags = []*lazyregexp.Regexp{
var validCompilerFlagsWithNextArg = []string{
"-arch",
"-D",
+ "-U",
"-I",
"-framework",
"-isysroot",
@@ -280,6 +283,15 @@ Args:
continue Args
}
+ // Permit -I= /path, -I $SYSROOT.
+ if i+1 < len(list) && arg == "-I" {
+ if (strings.HasPrefix(list[i+1], "=") || strings.HasPrefix(list[i+1], "$SYSROOT")) &&
+ load.SafeArg(list[i+1][1:]) {
+ i++
+ continue Args
+ }
+ }
+
if i+1 < len(list) {
return fmt.Errorf("invalid flag in %s: %s %s (see https://golang.org/s/invalidflag)", source, arg, list[i+1])
}
diff --git a/libgo/go/cmd/go/internal/work/security_test.go b/libgo/go/cmd/go/internal/work/security_test.go
index fd8caeab4ec..6b85c40b13b 100644
--- a/libgo/go/cmd/go/internal/work/security_test.go
+++ b/libgo/go/cmd/go/internal/work/security_test.go
@@ -12,6 +12,7 @@ import (
var goodCompilerFlags = [][]string{
{"-DFOO"},
{"-Dfoo=bar"},
+ {"-Ufoo"},
{"-F/Qt"},
{"-I/"},
{"-I/etc/passwd"},
@@ -21,6 +22,8 @@ var goodCompilerFlags = [][]string{
{"-Osmall"},
{"-W"},
{"-Wall"},
+ {"-Wp,-Dfoo=bar"},
+ {"-Wp,-Ufoo"},
{"-fobjc-arc"},
{"-fno-objc-arc"},
{"-fomit-frame-pointer"},
@@ -56,6 +59,9 @@ var goodCompilerFlags = [][]string{
{"-I", "."},
{"-I", "/etc/passwd"},
{"-I", "世界"},
+ {"-I", "=/usr/include/libxml2"},
+ {"-I", "dir"},
+ {"-I", "$SYSROOT/dir"},
{"-framework", "Chocolate"},
{"-x", "c"},
{"-v"},
@@ -64,6 +70,7 @@ var goodCompilerFlags = [][]string{
var badCompilerFlags = [][]string{
{"-D@X"},
{"-D-X"},
+ {"-Ufoo=bar"},
{"-F@dir"},
{"-F-dir"},
{"-I@dir"},
@@ -83,6 +90,7 @@ var badCompilerFlags = [][]string{
{"-D", "-foo"},
{"-I", "@foo"},
{"-I", "-foo"},
+ {"-I", "=@obj"},
{"-framework", "-Caffeine"},
{"-framework", "@Home"},
{"-x", "--c"},
@@ -143,6 +151,7 @@ var goodLinkerFlags = [][]string{
{"-L", "framework"},
{"-framework", "Chocolate"},
{"-v"},
+ {"-Wl,-sectcreate,__TEXT,__info_plist,${SRCDIR}/Info.plist"},
{"-Wl,-framework", "-Wl,Chocolate"},
{"-Wl,-framework,Chocolate"},
{"-Wl,-unresolved-symbols=ignore-all"},
diff --git a/libgo/go/cmd/go/main.go b/libgo/go/cmd/go/main.go
index 16bdb6209f1..bb442b5f8e4 100644
--- a/libgo/go/cmd/go/main.go
+++ b/libgo/go/cmd/go/main.go
@@ -91,7 +91,7 @@ func main() {
}
if args[0] == "get" || args[0] == "help" {
- if modload.Init(); !modload.Enabled() {
+ if !modload.WillBeEnabled() {
// Replace module-aware get with GOPATH get if appropriate.
*modget.CmdGet = *get.CmdGet
}
diff --git a/libgo/go/cmd/go/proxy_test.go b/libgo/go/cmd/go/proxy_test.go
index 6919d321847..8214488a59a 100644
--- a/libgo/go/cmd/go/proxy_test.go
+++ b/libgo/go/cmd/go/proxy_test.go
@@ -23,14 +23,15 @@ import (
"sync"
"testing"
- "cmd/go/internal/dirhash"
"cmd/go/internal/modfetch"
"cmd/go/internal/modfetch/codehost"
- "cmd/go/internal/module"
"cmd/go/internal/par"
- "cmd/go/internal/semver"
- "cmd/go/internal/sumweb"
"cmd/go/internal/txtar"
+
+ "golang.org/x/mod/module"
+ "golang.org/x/mod/semver"
+ "golang.org/x/mod/sumdb"
+ "golang.org/x/mod/sumdb/dirhash"
)
var (
@@ -65,7 +66,7 @@ func StartProxy() {
// Prepopulate main sumdb.
for _, mod := range modList {
- sumdbHandler.Server.Lookup(nil, mod.Path+"@"+mod.Version)
+ sumdbOps.Lookup(nil, mod)
}
})
}
@@ -88,7 +89,7 @@ func readModList() {
continue
}
encPath := strings.ReplaceAll(name[:i], "_", "/")
- path, err := module.DecodePath(encPath)
+ path, err := module.UnescapePath(encPath)
if err != nil {
if encPath != "example.com/invalidpath/v1" {
fmt.Fprintf(os.Stderr, "go proxy_test: %v\n", err)
@@ -96,7 +97,7 @@ func readModList() {
continue
}
encVers := name[i+1:]
- vers, err := module.DecodeVersion(encVers)
+ vers, err := module.UnescapeVersion(encVers)
if err != nil {
fmt.Fprintf(os.Stderr, "go proxy_test: %v\n", err)
continue
@@ -113,8 +114,13 @@ const (
testSumDBSignerKey = "PRIVATE+KEY+localhost.localdev/sumdb+00000c67+AXu6+oaVaOYuQOFrf1V59JK1owcFlJcHwwXHDfDGxSPk"
)
-var sumdbHandler = &sumweb.Handler{Server: sumweb.NewTestServer(testSumDBSignerKey, proxyGoSum)}
-var sumdbWrongHandler = &sumweb.Handler{Server: sumweb.NewTestServer(testSumDBSignerKey, proxyGoSumWrong)}
+var (
+ sumdbOps = sumdb.NewTestServer(testSumDBSignerKey, proxyGoSum)
+ sumdbServer = sumdb.NewServer(sumdbOps)
+
+ sumdbWrongOps = sumdb.NewTestServer(testSumDBSignerKey, proxyGoSumWrong)
+ sumdbWrongServer = sumdb.NewServer(sumdbWrongOps)
+)
// proxyHandler serves the Go module proxy protocol.
// See the proxy section of https://research.swtch.com/vgo-module.
@@ -155,7 +161,7 @@ func proxyHandler(w http.ResponseWriter, r *http.Request) {
// (Client thinks it is talking directly to a sumdb.)
if strings.HasPrefix(path, "sumdb-direct/") {
r.URL.Path = path[len("sumdb-direct"):]
- sumdbHandler.ServeHTTP(w, r)
+ sumdbServer.ServeHTTP(w, r)
return
}
@@ -164,7 +170,7 @@ func proxyHandler(w http.ResponseWriter, r *http.Request) {
// (Client thinks it is talking directly to a sumdb.)
if strings.HasPrefix(path, "sumdb-wrong/") {
r.URL.Path = path[len("sumdb-wrong"):]
- sumdbWrongHandler.ServeHTTP(w, r)
+ sumdbWrongServer.ServeHTTP(w, r)
return
}
@@ -178,7 +184,7 @@ func proxyHandler(w http.ResponseWriter, r *http.Request) {
// Request for $GOPROXY/sumdb/<name>/... goes to sumdb.
if sumdbPrefix := "sumdb/" + testSumDBName + "/"; strings.HasPrefix(path, sumdbPrefix) {
r.URL.Path = path[len(sumdbPrefix)-1:]
- sumdbHandler.ServeHTTP(w, r)
+ sumdbServer.ServeHTTP(w, r)
return
}
@@ -187,7 +193,7 @@ func proxyHandler(w http.ResponseWriter, r *http.Request) {
// latest version, including pseudo-versions.
if i := strings.LastIndex(path, "/@latest"); i >= 0 {
enc := path[:i]
- modPath, err := module.DecodePath(enc)
+ modPath, err := module.UnescapePath(enc)
if err != nil {
if !quiet {
fmt.Fprintf(os.Stderr, "go proxy_test: %v\n", err)
@@ -225,7 +231,7 @@ func proxyHandler(w http.ResponseWriter, r *http.Request) {
return
}
- encVers, err := module.EncodeVersion(latest)
+ encVers, err := module.EscapeVersion(latest)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
@@ -240,7 +246,7 @@ func proxyHandler(w http.ResponseWriter, r *http.Request) {
return
}
enc, file := path[:i], path[i+len("/@v/"):]
- path, err := module.DecodePath(enc)
+ path, err := module.UnescapePath(enc)
if err != nil {
if !quiet {
fmt.Fprintf(os.Stderr, "go proxy_test: %v\n", err)
@@ -276,7 +282,7 @@ func proxyHandler(w http.ResponseWriter, r *http.Request) {
return
}
encVers, ext := file[:i], file[i+1:]
- vers, err := module.DecodeVersion(encVers)
+ vers, err := module.UnescapeVersion(encVers)
if err != nil {
fmt.Fprintf(os.Stderr, "go proxy_test: %v\n", err)
http.NotFound(w, r)
@@ -397,11 +403,11 @@ var archiveCache par.Cache
var cmdGoDir, _ = os.Getwd()
func readArchive(path, vers string) (*txtar.Archive, error) {
- enc, err := module.EncodePath(path)
+ enc, err := module.EscapePath(path)
if err != nil {
return nil, err
}
- encVers, err := module.EncodeVersion(vers)
+ encVers, err := module.EscapeVersion(vers)
if err != nil {
return nil, err
}
diff --git a/libgo/go/cmd/go/script_test.go b/libgo/go/cmd/go/script_test.go
index 4dcb4b4e0d5..ec498bbcd76 100644
--- a/libgo/go/cmd/go/script_test.go
+++ b/libgo/go/cmd/go/script_test.go
@@ -30,6 +30,7 @@ import (
"cmd/go/internal/robustio"
"cmd/go/internal/txtar"
"cmd/go/internal/work"
+ "cmd/internal/sys"
)
// TestScript runs the tests in testdata/script/*.txt.
@@ -117,6 +118,7 @@ func (ts *testScript) setup() {
"GOSUMDB=" + testSumDBVerifierKey,
"GONOPROXY=",
"GONOSUMDB=",
+ "PWD=" + ts.cd,
tempEnvName() + "=" + filepath.Join(ts.workdir, "tmp"),
"devnull=" + os.DevNull,
"goversion=" + goVersion(ts),
@@ -291,6 +293,22 @@ Script:
}).(bool)
break
}
+ if strings.HasPrefix(cond.tag, "GODEBUG:") {
+ value := strings.TrimPrefix(cond.tag, "GODEBUG:")
+ parts := strings.Split(os.Getenv("GODEBUG"), ",")
+ for _, p := range parts {
+ if strings.TrimSpace(p) == value {
+ ok = true
+ break
+ }
+ }
+ break
+ }
+ if strings.HasPrefix(cond.tag, "buildmode:") {
+ value := strings.TrimPrefix(cond.tag, "buildmode:")
+ ok = sys.BuildModeSupported(runtime.Compiler, value, runtime.GOOS, runtime.GOARCH)
+ break
+ }
if !imports.KnownArch[cond.tag] && !imports.KnownOS[cond.tag] && cond.tag != "gc" && cond.tag != "gccgo" {
ts.fatalf("unknown condition %q", cond.tag)
}
@@ -414,6 +432,7 @@ func (ts *testScript) cmdCd(neg bool, args []string) {
ts.fatalf("%s is not a directory", dir)
}
ts.cd = dir
+ ts.envMap["PWD"] = dir
fmt.Fprintf(&ts.log, "%s\n", ts.cd)
}
@@ -429,7 +448,11 @@ func (ts *testScript) cmdChmod(neg bool, args []string) {
if err != nil || perm&uint64(os.ModePerm) != perm {
ts.fatalf("invalid mode: %s", args[0])
}
- for _, path := range args[1:] {
+ for _, arg := range args[1:] {
+ path := arg
+ if !filepath.IsAbs(path) {
+ path = filepath.Join(ts.cd, arg)
+ }
err := os.Chmod(path, os.FileMode(perm))
ts.check(err)
}
@@ -441,10 +464,15 @@ func (ts *testScript) cmdCmp(neg bool, args []string) {
// It would be strange to say "this file can have any content except this precise byte sequence".
ts.fatalf("unsupported: ! cmp")
}
+ quiet := false
+ if len(args) > 0 && args[0] == "-q" {
+ quiet = true
+ args = args[1:]
+ }
if len(args) != 2 {
ts.fatalf("usage: cmp file1 file2")
}
- ts.doCmdCmp(args, false)
+ ts.doCmdCmp(args, false, quiet)
}
// cmpenv compares two files with environment variable substitution.
@@ -452,13 +480,18 @@ func (ts *testScript) cmdCmpenv(neg bool, args []string) {
if neg {
ts.fatalf("unsupported: ! cmpenv")
}
+ quiet := false
+ if len(args) > 0 && args[0] == "-q" {
+ quiet = true
+ args = args[1:]
+ }
if len(args) != 2 {
ts.fatalf("usage: cmpenv file1 file2")
}
- ts.doCmdCmp(args, true)
+ ts.doCmdCmp(args, true, quiet)
}
-func (ts *testScript) doCmdCmp(args []string, env bool) {
+func (ts *testScript) doCmdCmp(args []string, env, quiet bool) {
name1, name2 := args[0], args[1]
var text1, text2 string
if name1 == "stdout" {
@@ -484,15 +517,14 @@ func (ts *testScript) doCmdCmp(args []string, env bool) {
return
}
- fmt.Fprintf(&ts.log, "[diff -%s +%s]\n%s\n", name1, name2, diff(text1, text2))
+ if !quiet {
+ fmt.Fprintf(&ts.log, "[diff -%s +%s]\n%s\n", name1, name2, diff(text1, text2))
+ }
ts.fatalf("%s and %s differ", name1, name2)
}
// cp copies files, maybe eventually directories.
func (ts *testScript) cmdCp(neg bool, args []string) {
- if neg {
- ts.fatalf("unsupported: ! cp")
- }
if len(args) < 2 {
ts.fatalf("usage: cp src... dst")
}
@@ -531,7 +563,14 @@ func (ts *testScript) cmdCp(neg bool, args []string) {
if dstDir {
targ = filepath.Join(dst, filepath.Base(src))
}
- ts.check(ioutil.WriteFile(targ, data, mode))
+ err := ioutil.WriteFile(targ, data, mode)
+ if neg {
+ if err == nil {
+ ts.fatalf("unexpected command success")
+ }
+ } else {
+ ts.check(err)
+ }
}
}
@@ -547,26 +586,31 @@ func (ts *testScript) cmdEnv(neg bool, args []string) {
args = args[1:]
}
+ var out strings.Builder
if len(args) == 0 {
printed := make(map[string]bool) // env list can have duplicates; only print effective value (from envMap) once
for _, kv := range ts.env {
k := kv[:strings.Index(kv, "=")]
if !printed[k] {
- fmt.Fprintf(&ts.log, "%s=%s\n", k, ts.envMap[k])
+ fmt.Fprintf(&out, "%s=%s\n", k, ts.envMap[k])
}
}
- return
- }
- for _, env := range args {
- i := strings.Index(env, "=")
- if i < 0 {
- // Display value instead of setting it.
- fmt.Fprintf(&ts.log, "%s=%s\n", env, ts.envMap[env])
- continue
+ } else {
+ for _, env := range args {
+ i := strings.Index(env, "=")
+ if i < 0 {
+ // Display value instead of setting it.
+ fmt.Fprintf(&out, "%s=%s\n", env, ts.envMap[env])
+ continue
+ }
+ key, val := env[:i], conv(env[i+1:])
+ ts.env = append(ts.env, key+"="+val)
+ ts.envMap[key] = val
}
- key, val := env[:i], conv(env[i+1:])
- ts.env = append(ts.env, key+"="+val)
- ts.envMap[key] = val
+ }
+ if out.Len() > 0 || len(args) > 0 {
+ ts.stdout = out.String()
+ ts.log.WriteString(out.String())
}
}
diff --git a/libgo/go/cmd/go/testdata/dep_test.go b/libgo/go/cmd/go/testdata/dep_test.go
deleted file mode 100644
index ac39a5bb1c2..00000000000
--- a/libgo/go/cmd/go/testdata/dep_test.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package deps
-
-import _ "testing"
diff --git a/libgo/go/cmd/go/testdata/local/easy.go b/libgo/go/cmd/go/testdata/local/easy.go
deleted file mode 100644
index 4eeb517da15..00000000000
--- a/libgo/go/cmd/go/testdata/local/easy.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package main
-
-import "./easysub"
-
-func main() {
- easysub.Hello()
-}
diff --git a/libgo/go/cmd/go/testdata/local/easysub/easysub.go b/libgo/go/cmd/go/testdata/local/easysub/easysub.go
deleted file mode 100644
index 07040daee57..00000000000
--- a/libgo/go/cmd/go/testdata/local/easysub/easysub.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package easysub
-
-import "fmt"
-
-func Hello() {
- fmt.Println("easysub.Hello")
-}
diff --git a/libgo/go/cmd/go/testdata/local/easysub/main.go b/libgo/go/cmd/go/testdata/local/easysub/main.go
deleted file mode 100644
index 6c30b52362e..00000000000
--- a/libgo/go/cmd/go/testdata/local/easysub/main.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// +build ignore
-
-package main
-
-import "."
-
-func main() {
- easysub.Hello()
-}
diff --git a/libgo/go/cmd/go/testdata/local/hard.go b/libgo/go/cmd/go/testdata/local/hard.go
deleted file mode 100644
index 2ffac3fd73b..00000000000
--- a/libgo/go/cmd/go/testdata/local/hard.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package main
-
-import "./sub"
-
-func main() {
- sub.Hello()
-}
diff --git a/libgo/go/cmd/go/testdata/local/sub/sub.go b/libgo/go/cmd/go/testdata/local/sub/sub.go
deleted file mode 100644
index d5dbf6d5fa5..00000000000
--- a/libgo/go/cmd/go/testdata/local/sub/sub.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package sub
-
-import (
- "fmt"
-
- subsub "./sub"
-)
-
-func Hello() {
- fmt.Println("sub.Hello")
- subsub.Hello()
-}
diff --git a/libgo/go/cmd/go/testdata/local/sub/sub/subsub.go b/libgo/go/cmd/go/testdata/local/sub/sub/subsub.go
deleted file mode 100644
index 4cc72233e13..00000000000
--- a/libgo/go/cmd/go/testdata/local/sub/sub/subsub.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package subsub
-
-import "fmt"
-
-func Hello() {
- fmt.Println("subsub.Hello")
-}
diff --git a/libgo/go/cmd/go/testdata/mod/example.com_dotgo.go_v1.0.0.txt b/libgo/go/cmd/go/testdata/mod/example.com_dotgo.go_v1.0.0.txt
new file mode 100644
index 00000000000..4f7f4d7dd21
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/mod/example.com_dotgo.go_v1.0.0.txt
@@ -0,0 +1,16 @@
+This module's path ends with ".go".
+Based on github.com/nats-io/nats.go.
+Used in regression tests for golang.org/issue/32483.
+
+-- .mod --
+module example.com/dotgo.go
+
+go 1.13
+-- .info --
+{"Version":"v1.0.0"}
+-- go.mod --
+module example.com/dotgo.go
+
+go 1.13
+-- dotgo.go --
+package dotgo
diff --git a/libgo/go/cmd/go/testdata/mod/example.com_stack_v1.0.0.txt b/libgo/go/cmd/go/testdata/mod/example.com_stack_v1.0.0.txt
new file mode 100644
index 00000000000..787b7aedfa4
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/mod/example.com_stack_v1.0.0.txt
@@ -0,0 +1,18 @@
+Module with a function that prints file name for the top stack frame.
+Different versions of this module are identical, but they should return
+different file names with -trimpath.
+-- .mod --
+module example.com/stack
+
+go 1.14
+-- .info --
+{"Version":"v1.0.0"}
+-- stack.go --
+package stack
+
+import "runtime"
+
+func TopFile() string {
+ _, file, _, _ := runtime.Caller(0)
+ return file
+}
diff --git a/libgo/go/cmd/go/testdata/mod/example.com_stack_v1.0.1.txt b/libgo/go/cmd/go/testdata/mod/example.com_stack_v1.0.1.txt
new file mode 100644
index 00000000000..c715dd234f7
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/mod/example.com_stack_v1.0.1.txt
@@ -0,0 +1,18 @@
+Module with a function that prints file name for the top stack frame.
+Different versions of this module are identical, but they should return
+different file names with -trimpath.
+-- .mod --
+module example.com/stack
+
+go 1.14
+-- .info --
+{"Version":"v1.0.1"}
+-- stack.go --
+package stack
+
+import "runtime"
+
+func TopFile() string {
+ _, file, _, _ := runtime.Caller(0)
+ return file
+}
diff --git a/libgo/go/cmd/go/testdata/mod/not-rsc.io_quote_v0.1.0-nomod.txt b/libgo/go/cmd/go/testdata/mod/not-rsc.io_quote_v0.1.0-nomod.txt
new file mode 100644
index 00000000000..efff08826ad
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/mod/not-rsc.io_quote_v0.1.0-nomod.txt
@@ -0,0 +1,59 @@
+Constructed by hand.
+(derived from rsc.io/quote@e7a685a342, but without an explicit go.mod file.)
+
+-- .mod --
+module "not-rsc.io/quote"
+-- .info --
+{"Version":"v0.1.0-nomod","Time":"2018-02-14T00:51:33Z"}
+-- quote.go --
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package quote collects pithy sayings.
+package quote // import "rsc.io/quote"
+
+// Hello returns a greeting.
+func Hello() string {
+ return "Hello, world."
+}
+
+// Glass returns a useful phrase for world travelers.
+func Glass() string {
+ // See http://www.oocities.org/nodotus/hbglass.html.
+ return "I can eat glass and it doesn't hurt me."
+}
+
+// Go returns a Go proverb.
+func Go() string {
+ return "Don't communicate by sharing memory, share memory by communicating."
+}
+-- quote_test.go --
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package quote
+
+import "testing"
+
+func TestHello(t *testing.T) {
+ hello := "Hello, world."
+ if out := Hello(); out != hello {
+ t.Errorf("Hello() = %q, want %q", out, hello)
+ }
+}
+
+func TestGlass(t *testing.T) {
+ glass := "I can eat glass and it doesn't hurt me."
+ if out := Glass(); out != glass {
+ t.Errorf("Glass() = %q, want %q", out, glass)
+ }
+}
+
+func TestGo(t *testing.T) {
+ go1 := "Don't communicate by sharing memory. Share memory by communicating."
+ if out := Go(); out != go1 {
+ t.Errorf("Go() = %q, want %q", out, go1)
+ }
+}
diff --git a/libgo/go/cmd/go/testdata/print_goroot.go b/libgo/go/cmd/go/testdata/print_goroot.go
index 54772910609..91fbf7d8ec3 100644
--- a/libgo/go/cmd/go/testdata/print_goroot.go
+++ b/libgo/go/cmd/go/testdata/print_goroot.go
@@ -4,8 +4,11 @@
package main
-import "runtime"
+import (
+ "fmt"
+ "runtime"
+)
func main() {
- println(runtime.GOROOT())
+ fmt.Println(runtime.GOROOT())
}
diff --git a/libgo/go/cmd/go/testdata/script/README b/libgo/go/cmd/go/testdata/script/README
index 66ab8515c33..2782a097079 100644
--- a/libgo/go/cmd/go/testdata/script/README
+++ b/libgo/go/cmd/go/testdata/script/README
@@ -38,6 +38,7 @@ Scripts also have access to these other environment variables:
TMPDIR=$WORK/tmp
devnull=<value of os.DevNull>
goversion=<current Go version; for example, 1.12>
+ :=<OS-specific path list separator>
The scripts supporting files are unpacked relative to $GOPATH/src (aka $WORK/gopath/src)
and then the script begins execution in that directory as well. Thus the example above runs
@@ -77,9 +78,13 @@ should only run when the condition is satisfied. The available conditions are:
- [root] for os.Geteuid() == 0
- [symlink] for testenv.HasSymlink()
- [exec:prog] for whether prog is available for execution (found by exec.LookPath)
+ - [GODEBUG:value] for whether value is one of the comma-separated entries in the GODEBUG variable
+ - [buildmode:value] for whether -buildmode=value is supported
A condition can be negated: [!short] means to run the rest of the line
-when testing.Short() is false.
+when testing.Short() is false. Multiple conditions may be given for a single
+command, for example, '[linux] [amd64] skip'. The command will run if all conditions
+are satisfied.
The commands are:
@@ -105,13 +110,14 @@ The commands are:
Like cmp, but environment variables are substituted in the file contents
before the comparison. For example, $GOOS is replaced by the target GOOS.
-- cp src... dst
+- [!] cp src... dst
Copy the listed files to the target file or existing directory.
src can include "stdout" or "stderr" to use the standard output or standard error
from the most recent exec or go command.
- env [-r] [key=value...]
- With no arguments, print the environment (useful for debugging).
+ With no arguments, print the environment to stdout
+ (useful for debugging and for verifying initial state).
Otherwise add the listed key=value pairs to the environment.
The -r flag causes the values to be escaped using regexp.QuoteMeta
before being recorded.
@@ -160,7 +166,7 @@ The commands are:
- [!] stdout [-count=N] pattern
Apply the grep command (see above) to the standard output
- from the most recent exec, go, or wait command.
+ from the most recent exec, go, wait, or env command.
- stop [message]
Stop the test early (marking it as passing), including the message if given.
diff --git a/libgo/go/cmd/go/testdata/script/bug.txt b/libgo/go/cmd/go/testdata/script/bug.txt
index db3ac253672..f52250a1b0b 100644
--- a/libgo/go/cmd/go/testdata/script/bug.txt
+++ b/libgo/go/cmd/go/testdata/script/bug.txt
@@ -1,14 +1,15 @@
# Verify that go bug creates the appropriate URL issue body
[!linux] skip
+[gccgo] skip
go install
env BROWSER=$GOPATH/bin/browser
go bug
exists $TMPDIR/browser
grep '^go version' $TMPDIR/browser
-[!gccgo] grep '^GOROOT/bin/go version: go version' $TMPDIR/browser
-[!gccgo] grep '^GOROOT/bin/go tool compile -V: compile version' $TMPDIR/browser
+grep '^GOROOT/bin/go version: go version' $TMPDIR/browser
+grep '^GOROOT/bin/go tool compile -V: compile version' $TMPDIR/browser
grep '^uname -sr: Linux' $TMPDIR/browser
-- go.mod --
diff --git a/libgo/go/cmd/go/testdata/script/build_cache_trimpath.txt b/libgo/go/cmd/go/testdata/script/build_cache_trimpath.txt
index 39367ae3809..9a4b9d7b40c 100644
--- a/libgo/go/cmd/go/testdata/script/build_cache_trimpath.txt
+++ b/libgo/go/cmd/go/testdata/script/build_cache_trimpath.txt
@@ -1,3 +1,4 @@
+[short] skip
env GO111MODULE=on
# Set up fresh GOCACHE.
@@ -12,9 +13,35 @@ go build -x -o a.out -trimpath
stderr '(compile|gccgo)( |\.exe)'
stderr 'link( |\.exe)'
+# Two distinct versions of the same module with identical content should
+# still be cached separately.
+# Verifies golang.org/issue/35412.
+go get -d example.com/stack@v1.0.0
+go run -trimpath printstack.go
+stdout '^example.com/stack@v1.0.0/stack.go$'
+go get -d example.com/stack@v1.0.1
+go run -trimpath printstack.go
+stdout '^example.com/stack@v1.0.1/stack.go$'
+
-- $WORK/hello.go --
package main
func main() { println("hello") }
+-- $WORK/printstack.go --
+// +build ignore
+
+package main
+
+import (
+ "fmt"
+
+ "example.com/stack"
+)
+
+func main() {
+ fmt.Println(stack.TopFile())
+}
-- $WORK/go.mod --
module m
+
+go 1.14
diff --git a/libgo/go/cmd/go/testdata/script/build_gcflags.txt b/libgo/go/cmd/go/testdata/script/build_gcflags.txt
new file mode 100644
index 00000000000..e0accb10d50
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/build_gcflags.txt
@@ -0,0 +1,21 @@
+env GO111MODULE=off
+
+# Test that the user can override default code generation flags.
+
+[gccgo] skip # gccgo does not use -gcflags
+[!cgo] skip
+[!linux] skip # test only works if c-archive implies -shared
+[short] skip
+
+go build -x -buildmode=c-archive -gcflags=all=-shared=false ./override.go
+stderr '^.*/compile (.* )?-shared (.* )?-shared=false'
+
+-- override.go --
+package main
+
+import "C"
+
+//export GoFunc
+func GoFunc() {}
+
+func main() {}
diff --git a/libgo/go/cmd/go/testdata/script/build_i.txt b/libgo/go/cmd/go/testdata/script/build_i.txt
new file mode 100644
index 00000000000..0e7ebed0f99
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/build_i.txt
@@ -0,0 +1,41 @@
+env GO111MODULE=off
+
+# Test that 'go build -i' installs dependencies of the requested package.
+
+[short] skip
+
+# Since we are checking installation of dependencies, use a clean cache
+# to ensure that multiple runs of the test do not interfere.
+env GOCACHE=$WORK/cache
+
+# The initial 'go build -i' for bar should install its dependency foo.
+
+go build -v -i x/y/bar
+stderr 'x/y/foo' # should be rebuilt
+go build -v -i x/y/bar
+! stderr 'x/y/foo' # should already be installed
+
+# After modifying the source files, both packages should be rebuild.
+
+cp x/y/foo/foo.go.next x/y/foo/foo.go
+cp x/y/bar/bar.go.next x/y/bar/bar.go
+
+go build -v -i x/y/bar
+stderr 'x/y/foo' # should be rebuilt
+go build -v -i x/y/bar
+! stderr 'x/y/foo' # should already be installed
+
+-- x/y/foo/foo.go --
+package foo
+func F() {}
+-- x/y/bar/bar.go --
+package bar
+import "x/y/foo"
+func F() { foo.F() }
+-- x/y/foo/foo.go.next --
+package foo
+func F() { F() }
+-- x/y/bar/bar.go.next --
+package main
+import "x/y/foo"
+func main() { foo.F() }
diff --git a/libgo/go/cmd/go/testdata/script/build_multi_main.txt b/libgo/go/cmd/go/testdata/script/build_multi_main.txt
index 1d4926d9790..8afd8b8a2e1 100644
--- a/libgo/go/cmd/go/testdata/script/build_multi_main.txt
+++ b/libgo/go/cmd/go/testdata/script/build_multi_main.txt
@@ -10,6 +10,11 @@ stderr 'no main packages'
! go build ./cmd/c1
stderr 'already exists and is a directory'
+# Verify build -o output correctly local packages
+mkdir $WORK/local
+go build -o $WORK/local ./exec.go
+exists $WORK/local/exec$GOEXE
+
-- go.mod --
module exmod
@@ -29,5 +34,10 @@ package pkg1
-- pkg2/pkg2.go --
package pkg2
+-- exec.go --
+package main
+
+func main() {}
+
-- c1$GOEXE/keep.txt --
Create c1 directory.
diff --git a/libgo/go/cmd/go/testdata/script/build_trimpath.txt b/libgo/go/cmd/go/testdata/script/build_trimpath.txt
index f785b0cb9ec..cfab80743ea 100644
--- a/libgo/go/cmd/go/testdata/script/build_trimpath.txt
+++ b/libgo/go/cmd/go/testdata/script/build_trimpath.txt
@@ -1,21 +1,132 @@
[short] skip
-env -r GOROOT_REGEXP=$GOROOT
-env -r WORK_REGEXP=$WORK
-env GOROOT GOROOT_REGEXP WORK WORK_REGEXP
+# Set up two identical directories that can be used as GOPATH.
+env GO111MODULE=on
+mkdir $WORK/a/src/paths $WORK/b/src/paths
+cp paths.go $WORK/a/src/paths
+cp paths.go $WORK/b/src/paths
+cp go.mod $WORK/a/src/paths/
+cp go.mod $WORK/b/src/paths/
-go build -trimpath -o hello.exe hello.go
-! grep -q $GOROOT_REGEXP hello.exe
-! grep -q $WORK_REGEXP hello.exe
-env GO111MODULE=on
-go build -trimpath -o fortune.exe rsc.io/fortune
-! grep -q $GOROOT_REGEXP fortune.exe
-! grep -q $WORK_REGEXP fortune.exe
+# A binary built without -trimpath should contain the module root dir
+# and GOROOT for debugging and stack traces.
+cd $WORK/a/src/paths
+go build -o $WORK/paths-dbg.exe .
+exec $WORK/paths-dbg.exe $WORK/paths-dbg.exe
+stdout 'binary contains module root: true'
+stdout 'binary contains GOROOT: true'
+
+# A binary built with -trimpath should not contain the current workspace
+# or GOROOT.
+go build -trimpath -o $WORK/paths-a.exe .
+exec $WORK/paths-a.exe $WORK/paths-a.exe
+stdout 'binary contains module root: false'
+stdout 'binary contains GOROOT: false'
+
+# A binary from an external module built with -trimpath should not contain
+# the current workspace or GOROOT.
+go get -trimpath rsc.io/fortune
+exec $WORK/paths-a.exe $GOPATH/bin/fortune$GOEXE
+stdout 'binary contains module root: false'
+stdout 'binary contains GOROOT: false'
+go mod edit -droprequire rsc.io/fortune
+
+# Two binaries built from identical packages in different directories
+# should be identical.
+cd $WORK/b/src/paths
+go build -trimpath -o $WORK/paths-b.exe
+cmp -q $WORK/paths-a.exe $WORK/paths-b.exe
+
+
+# Same sequence of tests but in GOPATH mode.
+# A binary built without -trimpath should contain GOPATH and GOROOT.
+env GO111MODULE=off
+cd $WORK
+env GOPATH=$WORK/a
+go build -o paths-dbg.exe paths
+exec ./paths-dbg.exe paths-dbg.exe
+stdout 'binary contains GOPATH: true'
+stdout 'binary contains GOROOT: true'
+
+# A binary built with -trimpath should not contain GOPATH or GOROOT.
+go build -trimpath -o paths-a.exe paths
+exec ./paths-a.exe paths-a.exe
+stdout 'binary contains GOPATH: false'
+stdout 'binary contains GOROOT: false'
+
+# Two binaries built from identical packages in different GOPATH roots
+# should be identical.
+env GOPATH=$WORK/b
+go build -trimpath -o paths-b.exe paths
+cmp -q paths-a.exe paths-b.exe
+
--- hello.go --
+# Same sequence of tests but with gccgo.
+# gccgo does not support builds in module mode.
+[!exec:gccgo] stop
+env GOPATH=$WORK/a
+
+# A binary built with gccgo without -trimpath should contain the current
+# GOPATH and GOROOT.
+go build -compiler=gccgo -o paths-dbg.exe paths
+exec ./paths-dbg.exe paths-dbg.exe
+stdout 'binary contains GOPATH: true'
+stdout 'binary contains GOROOT: false' # gccgo doesn't load std from GOROOT.
+
+# A binary built with gccgo with -trimpath should not contain GOPATH or GOROOT.
+go build -compiler=gccgo -trimpath -o paths-a.exe paths
+exec ./paths-a.exe paths-a.exe
+stdout 'binary contains GOPATH: false'
+stdout 'binary contains GOROOT: false'
+
+# Two binaries built from identical packages in different directories
+# should be identical.
+env GOPATH=$WORK/b
+go build -compiler=gccgo -trimpath -o paths-b.exe paths
+cmp -q paths-a.exe paths-b.exe
+
+-- paths.go --
package main
-func main() { println("hello") }
+
+import (
+ "bytes"
+ "fmt"
+ "io/ioutil"
+ "log"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "strings"
+)
+
+func main() {
+ exe := os.Args[1]
+ data, err := ioutil.ReadFile(exe)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ if os.Getenv("GO111MODULE") == "on" {
+ out, err := exec.Command("go", "env", "GOMOD").Output()
+ if err != nil {
+ log.Fatal(err)
+ }
+ modRoot := filepath.Dir(strings.TrimSpace(string(out)))
+ check(data, "module root", modRoot)
+ } else {
+ check(data, "GOPATH", os.Getenv("GOPATH"))
+ }
+ check(data, "GOROOT", os.Getenv("GOROOT"))
+}
+
+func check(data []byte, desc, dir string) {
+ containsDir := bytes.Contains(data, []byte(dir))
+ containsSlashDir := bytes.Contains(data, []byte(filepath.ToSlash(dir)))
+ fmt.Printf("binary contains %s: %v\n", desc, containsDir || containsSlashDir)
+}
-- go.mod --
-module m
+module paths
+
+go 1.14
diff --git a/libgo/go/cmd/go/testdata/script/cache_vet.txt b/libgo/go/cmd/go/testdata/script/cache_vet.txt
new file mode 100644
index 00000000000..928024e0340
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/cache_vet.txt
@@ -0,0 +1,22 @@
+env GO111MODULE=off
+
+[short] skip
+[GODEBUG:gocacheverify=1] skip
+[gccgo] skip # gccgo has no standard packages
+
+# Start with a clean build cache:
+# test failures may be masked if the cache has just the right entries already.
+env GOCACHE=$WORK/cache
+
+# Run 'go vet os/user' once to warm up the cache.
+go vet os/user
+
+# Check that second vet reuses cgo-derived inputs.
+# The first command could be build instead of vet,
+# except that if the cache is empty and there's a net.a
+# in GOROOT/pkg, the build will not bother to regenerate
+# and cache the cgo outputs, whereas vet always will.
+
+go vet -x os/user
+! stderr '^(clang|gcc)' # should not have run compiler
+! stderr '[\\/]cgo ' # should not have run cgo
diff --git a/libgo/go/cmd/go/testdata/script/cmd_import_error.txt b/libgo/go/cmd/go/testdata/script/cmd_import_error.txt
index ba94f9bd3eb..685c606a413 100644
--- a/libgo/go/cmd/go/testdata/script/cmd_import_error.txt
+++ b/libgo/go/cmd/go/testdata/script/cmd_import_error.txt
@@ -5,7 +5,7 @@ env GO111MODULE=on
# a clear error in module mode.
! go list cmd/unknown
-stderr '^can''t load package: package cmd/unknown: package cmd/unknown is not in GOROOT \('$GOROOT'[/\\]src[/\\]cmd[/\\]unknown\)$'
+stderr '^can''t load package: package cmd/unknown is not in GOROOT \('$GOROOT'[/\\]src[/\\]cmd[/\\]unknown\)$'
go list -f '{{range .DepsErrors}}{{.Err}}{{end}}' x.go
stdout '^package cmd/unknown is not in GOROOT \('$GOROOT'[/\\]src[/\\]cmd[/\\]unknown\)$'
diff --git a/libgo/go/cmd/go/testdata/script/cover_mod_empty.txt b/libgo/go/cmd/go/testdata/script/cover_mod_empty.txt
new file mode 100644
index 00000000000..20c9199ae7d
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/cover_mod_empty.txt
@@ -0,0 +1,11 @@
+[gccgo] skip
+
+go tool cover -func=cover.out
+stdout total.*statements.*0.0%
+
+go mod init golang.org/issue/33855
+
+go tool cover -func=cover.out
+stdout total.*statements.*0.0%
+
+-- cover.out --
diff --git a/libgo/go/cmd/go/testdata/script/cover_modes.txt b/libgo/go/cmd/go/testdata/script/cover_modes.txt
new file mode 100644
index 00000000000..f8a399d0e60
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/cover_modes.txt
@@ -0,0 +1,25 @@
+env GO111MODULE=off
+
+# Coverage analysis should use 'set' mode by default,
+# and should merge coverage profiles correctly.
+
+[short] skip
+[gccgo] skip # gccgo has no cover tool
+
+go test -short -cover encoding/binary errors -coverprofile=$WORK/cover.out
+! stderr '[^0-9]0\.0%'
+! stdout '[^0-9]0\.0%'
+
+grep -count=1 '^mode: set$' $WORK/cover.out
+grep 'errors\.go' $WORK/cover.out
+grep 'binary\.go' $WORK/cover.out
+
+[!race] stop
+
+go test -short -race -cover encoding/binary errors -coverprofile=$WORK/cover.out
+! stderr '[^0-9]0\.0%'
+! stdout '[^0-9]0\.0%'
+
+grep -count=1 '^mode: atomic$' $WORK/cover.out
+grep 'errors\.go' $WORK/cover.out
+grep 'binary\.go' $WORK/cover.out
diff --git a/libgo/go/cmd/go/testdata/script/cover_pkgall_multiple_mains.txt b/libgo/go/cmd/go/testdata/script/cover_pkgall_multiple_mains.txt
index ab7cd66949d..f21cd8b3a8e 100644
--- a/libgo/go/cmd/go/testdata/script/cover_pkgall_multiple_mains.txt
+++ b/libgo/go/cmd/go/testdata/script/cover_pkgall_multiple_mains.txt
@@ -1,29 +1,32 @@
# This test checks that multiple main packages can be tested
# with -coverpkg=all without duplicate symbol errors.
-# Verifies golang.org/issue/30374.
-
-env GO111MODULE=on
+# Verifies golang.org/issue/30374, golang.org/issue/34114.
[short] skip
+cd $GOPATH/src/example.com/cov
+
+env GO111MODULE=on
+go test -coverpkg=all ./...
+env GO111MODULE=off
go test -coverpkg=all ./...
--- go.mod --
+-- $GOPATH/src/example.com/cov/go.mod --
module example.com/cov
--- mainonly/mainonly.go --
+-- $GOPATH/src/example.com/cov/mainonly/mainonly.go --
package main
func main() {}
--- mainwithtest/mainwithtest.go --
+-- $GOPATH/src/example.com/cov/mainwithtest/mainwithtest.go --
package main
func main() {}
func Foo() {}
--- mainwithtest/mainwithtest_test.go --
+-- $GOPATH/src/example.com/cov/mainwithtest/mainwithtest_test.go --
package main
import "testing"
@@ -32,10 +35,10 @@ func TestFoo(t *testing.T) {
Foo()
}
--- xtest/x.go --
+-- $GOPATH/src/example.com/cov/xtest/x.go --
package x
--- xtest/x_test.go --
+-- $GOPATH/src/example.com/cov/xtest/x_test.go --
package x_test
import "testing"
diff --git a/libgo/go/cmd/go/testdata/script/devnull.txt b/libgo/go/cmd/go/testdata/script/devnull.txt
new file mode 100644
index 00000000000..ccb866aed1a
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/devnull.txt
@@ -0,0 +1,26 @@
+env GO111MODULE=off
+
+# Issue 28035: go test -c -o NUL should work.
+# Issue 28549: go test -c -o /dev/null should not overwrite /dev/null when run as root.
+cd x
+cmp $devnull $WORK/empty.txt
+go test -o=$devnull -c
+! exists x.test$GOEXE
+cmp $devnull $WORK/empty.txt
+
+# Issue 12407: go build -o /dev/null should succeed.
+cd ..
+go build -o $devnull y
+cmp $devnull $WORK/empty.txt
+
+-- x/x_test.go --
+package x_test
+import (
+ "testing"
+)
+func TestNUL(t *testing.T) {
+}
+-- y/y.go --
+package y
+func main() {}
+-- $WORK/empty.txt --
diff --git a/libgo/go/cmd/go/testdata/script/env_write.txt b/libgo/go/cmd/go/testdata/script/env_write.txt
index 695cc83f3d7..1cc08466c96 100644
--- a/libgo/go/cmd/go/testdata/script/env_write.txt
+++ b/libgo/go/cmd/go/testdata/script/env_write.txt
@@ -85,3 +85,36 @@ stderr 'multiple values for key: GOOS'
# go env -w rejects missing variables
! go env -w GOOS
stderr 'arguments must be KEY=VALUE: invalid argument: GOOS'
+
+# go env -w rejects invalid GO111MODULE values, as otherwise cmd/go would break
+! go env -w GO111MODULE=badvalue
+stderr 'invalid GO111MODULE value "badvalue"'
+
+# go env -w rejects invalid GOPATH values
+! go env -w GOPATH=~/go
+stderr 'GOPATH entry cannot start with shell metacharacter'
+
+! go env -w GOPATH=./go
+stderr 'GOPATH entry is relative; must be absolute path'
+
+# go env -w/-u checks validity of GOOS/ARCH combinations
+[gccgo] skip
+env GOOS=
+env GOARCH=
+# check -w doesn't allow invalid GOOS
+! go env -w GOOS=linuxx
+stderr 'unsupported GOOS/GOARCH pair linuxx'
+# check -w doesn't allow invalid GOARCH
+! go env -w GOARCH=amd644
+stderr 'unsupported GOOS/GOARCH.*/amd644$'
+# check -w doesn't allow invalid GOOS with valid GOARCH
+! go env -w GOOS=linuxx GOARCH=amd64
+stderr 'unsupported GOOS/GOARCH pair linuxx'
+# check a valid GOOS and GOARCH values but an incompatible combinations
+! go env -w GOOS=android GOARCH=s390x
+stderr 'unsupported GOOS/GOARCH pair android/s390x'
+# check that -u considers explicit envs
+go env -w GOOS=linux GOARCH=mips
+env GOOS=windows
+! go env -u GOOS
+stderr 'unsupported GOOS/GOARCH.*windows/mips$'
diff --git a/libgo/go/cmd/go/testdata/script/fmt_load_errors.txt b/libgo/go/cmd/go/testdata/script/fmt_load_errors.txt
new file mode 100644
index 00000000000..297ec0fe3c7
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/fmt_load_errors.txt
@@ -0,0 +1,19 @@
+env GO111MODULE=off
+
+! go fmt does-not-exist
+
+go fmt -n exclude
+stdout 'exclude[/\\]x\.go'
+stdout 'exclude[/\\]x_linux\.go'
+
+-- exclude/empty/x.txt --
+-- exclude/ignore/_x.go --
+package x
+-- exclude/x.go --
+// +build linux,!linux
+
+package x
+-- exclude/x_linux.go --
+// +build windows
+
+package x
diff --git a/libgo/go/cmd/go/testdata/script/gccgo_m.txt b/libgo/go/cmd/go/testdata/script/gccgo_m.txt
new file mode 100644
index 00000000000..b63ba46ced0
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/gccgo_m.txt
@@ -0,0 +1,19 @@
+# It's absurd, but builds with -compiler=gccgo used to fail to build module m.
+# golang.org/issue/34358
+
+env GO111MODULE=off
+
+[short] skip
+
+cd m
+go build
+exists m$GOEXE
+rm m$GOEXE
+[exec:gccgo] go build -compiler=gccgo
+[exec:gccgo] exists m$GOEXE
+
+-- m/go.mod --
+module m
+-- m/main.go --
+package main
+func main() {}
diff --git a/libgo/go/cmd/go/testdata/script/gccgo_mangle.txt b/libgo/go/cmd/go/testdata/script/gccgo_mangle.txt
new file mode 100644
index 00000000000..7a09a8002ec
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/gccgo_mangle.txt
@@ -0,0 +1,15 @@
+# Issue 33871.
+
+cd m/a.0
+go build
+
+-- m/go.mod --
+module m
+-- m/a.0/a.go --
+package a
+
+type T int
+
+func (t T) M() int {
+ return int(t)
+}
diff --git a/libgo/go/cmd/go/testdata/script/get_insecure_redirect.txt b/libgo/go/cmd/go/testdata/script/get_insecure_redirect.txt
index a83b17672d4..0478d1f75de 100644
--- a/libgo/go/cmd/go/testdata/script/get_insecure_redirect.txt
+++ b/libgo/go/cmd/go/testdata/script/get_insecure_redirect.txt
@@ -1,11 +1,10 @@
# golang.org/issue/29591: 'go get' was following plain-HTTP redirects even without -insecure.
+# golang.org/issue/34049: 'go get' would panic in case of an insecure redirect in GOPATH mode
[!net] skip
[!exec:git] skip
-env GO111MODULE=on
-env GOPROXY=direct
-env GOSUMDB=off
+env GO111MODULE=off
! go get -d vcs-test.golang.org/insecure/go/insecure
stderr 'redirected .* to insecure URL'
diff --git a/libgo/go/cmd/go/testdata/script/goflags.txt b/libgo/go/cmd/go/testdata/script/goflags.txt
index fac6d807202..686d1138b83 100644
--- a/libgo/go/cmd/go/testdata/script/goflags.txt
+++ b/libgo/go/cmd/go/testdata/script/goflags.txt
@@ -49,3 +49,11 @@ stderr '^go: invalid boolean value \"asdf\" for flag -e \(from (\$GOFLAGS|%GOFLA
go env
stdout GOFLAGS
+# Flags listed in GOFLAGS should be safe to duplicate on the command line.
+env GOFLAGS=-tags=magic
+go list -tags=magic
+go test -tags=magic -c -o $devnull
+go vet -tags=magic
+
+-- foo_test.go --
+package foo
diff --git a/libgo/go/cmd/go/testdata/script/gopath_install.txt b/libgo/go/cmd/go/testdata/script/gopath_install.txt
new file mode 100644
index 00000000000..4b42fc593f9
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/gopath_install.txt
@@ -0,0 +1,53 @@
+# Regression test for 'go install' locations in GOPATH mode.
+env GO111MODULE=off
+[short] skip
+
+# Without $GOBIN set, binaries should be installed into the GOPATH bin directory.
+env GOBIN=
+rm $GOPATH/bin/go-cmd-test$GOEXE
+go install go-cmd-test
+exists $GOPATH/bin/go-cmd-test$GOEXE
+
+# With $GOBIN set, binaries should be installed to $GOBIN.
+env GOBIN=$WORK/bin1
+mkdir -p $GOBIN
+go install go-cmd-test
+exists $GOBIN/go-cmd-test$GOEXE
+
+# Issue 11065: installing to the current directory should create an executable.
+cd go-cmd-test
+env GOBIN=$PWD
+go install
+exists ./go-cmd-test$GOEXE
+cd ..
+
+# Without $GOBIN set, installing a program outside $GOPATH should fail
+# (there is nowhere to install it).
+env GOPATH= # reset to default ($HOME/go, which does not exist)
+env GOBIN=
+! go install go-cmd-test/helloworld.go
+stderr '^go install: no install location for \.go files listed on command line \(GOBIN not set\)$'
+
+# With $GOBIN set, should install there.
+env GOBIN=$WORK/bin1
+go install go-cmd-test/helloworld.go
+exists $GOBIN/helloworld$GOEXE
+
+# We can't assume that we can write to GOROOT, because it may not be writable.
+# However, we can check its install location using 'go list'.
+# cmd/fix should be installed to GOROOT/pkg, not GOPATH/bin.
+env GOPATH=$PWD
+go list -f '{{.Target}}' cmd/fix
+stdout $GOROOT'[/\\]pkg[/\\]tool[/\\]'$GOOS'_'$GOARCH'[/\\]fix'$GOEXE'$'
+
+# GOBIN should not affect toolchain install locations.
+env GOBIN=$WORK/bin1
+go list -f '{{.Target}}' cmd/fix
+stdout $GOROOT'[/\\]pkg[/\\]tool[/\\]'$GOOS'_'$GOARCH'[/\\]fix'$GOEXE'$'
+
+-- go-cmd-test/helloworld.go --
+package main
+
+func main() {
+ println("hello world")
+}
diff --git a/libgo/go/cmd/go/testdata/script/gopath_local.txt b/libgo/go/cmd/go/testdata/script/gopath_local.txt
new file mode 100644
index 00000000000..7ee1f83471c
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/gopath_local.txt
@@ -0,0 +1,117 @@
+env GO111MODULE=off # Relative imports only work in GOPATH mode.
+
+[short] skip
+
+# Imports should be resolved relative to the source file.
+go build testdata/local/easy.go
+exec ./easy$GOEXE
+stdout '^easysub\.Hello'
+
+# Ignored files should be able to import the package built from
+# non-ignored files in the same directory.
+go build -o easysub$GOEXE testdata/local/easysub/main.go
+exec ./easysub$GOEXE
+stdout '^easysub\.Hello'
+
+# Files in relative-imported packages should be able to
+# use relative imports themselves.
+go build testdata/local/hard.go
+exec ./hard$GOEXE
+stdout '^sub\.Hello'
+
+# Explicit source files listed on the command line should not install without
+# GOBIN set, since individual source files aren't part of the containing GOPATH.
+! go install testdata/local/easy.go
+stderr '^go install: no install location for \.go files listed on command line \(GOBIN not set\)$'
+
+[windows] stop # Windows does not allow the ridiculous directory name we're about to use.
+
+env BAD_DIR_NAME='#$%:, &()*;<=>?\^{}'
+
+mkdir -p testdata/$BAD_DIR_NAME/easysub
+mkdir -p testdata/$BAD_DIR_NAME/sub/sub
+
+cp testdata/local/easy.go testdata/$BAD_DIR_NAME/easy.go
+cp testdata/local/easysub/easysub.go testdata/$BAD_DIR_NAME/easysub/easysub.go
+cp testdata/local/easysub/main.go testdata/$BAD_DIR_NAME/easysub/main.go
+cp testdata/local/hard.go testdata/$BAD_DIR_NAME/hard.go
+cp testdata/local/sub/sub.go testdata/$BAD_DIR_NAME/sub/sub.go
+cp testdata/local/sub/sub/subsub.go testdata/$BAD_DIR_NAME/sub/sub/subsub.go
+
+# Imports should be resolved relative to the source file.
+go build testdata/$BAD_DIR_NAME/easy.go
+exec ./easy$GOEXE
+stdout '^easysub\.Hello'
+
+# Ignored files should be able to import the package built from
+# non-ignored files in the same directory.
+go build -o easysub$GOEXE testdata/$BAD_DIR_NAME/easysub/main.go
+exec ./easysub$GOEXE
+stdout '^easysub\.Hello'
+
+# Files in relative-imported packages should be able to
+# use relative imports themselves.
+go build testdata/$BAD_DIR_NAME/hard.go
+exec ./hard$GOEXE
+stdout '^sub\.Hello'
+
+# Explicit source files listed on the command line should not install without
+# GOBIN set, since individual source files aren't part of the containing GOPATH.
+! go install testdata/$BAD_DIR_NAME/easy.go
+stderr '^go install: no install location for \.go files listed on command line \(GOBIN not set\)$'
+
+-- testdata/local/easy.go --
+package main
+
+import "./easysub"
+
+func main() {
+ easysub.Hello()
+}
+-- testdata/local/easysub/easysub.go --
+package easysub
+
+import "fmt"
+
+func Hello() {
+ fmt.Println("easysub.Hello")
+}
+-- testdata/local/easysub/main.go --
+// +build ignore
+
+package main
+
+import "."
+
+func main() {
+ easysub.Hello()
+}
+-- testdata/local/hard.go --
+package main
+
+import "./sub"
+
+func main() {
+ sub.Hello()
+}
+-- testdata/local/sub/sub.go --
+package sub
+
+import (
+ "fmt"
+
+ subsub "./sub"
+)
+
+func Hello() {
+ fmt.Println("sub.Hello")
+ subsub.Hello()
+}
+-- testdata/local/sub/sub/subsub.go --
+package subsub
+
+import "fmt"
+
+func Hello() {
+ fmt.Println("subsub.Hello")
+}
diff --git a/libgo/go/cmd/go/testdata/script/gopath_moved_repo.txt b/libgo/go/cmd/go/testdata/script/gopath_moved_repo.txt
new file mode 100644
index 00000000000..869980da7c5
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/gopath_moved_repo.txt
@@ -0,0 +1,68 @@
+env GO111MODULE=off
+
+# Test that 'go get -u' reports packages whose VCS configurations do not
+# match their import paths.
+
+[!net] skip
+[short] skip
+
+# We need to execute a custom Go program to break the config files.
+#
+# git will ask for a username and password when we run 'go get -d -f -u',
+# so we also need to set GIT_ASKPASS. Conveniently, a single binary can
+# perform both tasks!
+
+go build -o replace.exe replace
+env GIT_ASKPASS=$PWD/replace.exe
+
+
+# Test that 'go get -u' reports moved git packages.
+
+[exec:git] go get -d rsc.io/pdf
+[exec:git] go get -d -u rsc.io/pdf
+[exec:git] exec ./replace.exe pdf rsc.io/pdf/.git/config
+
+[exec:git] ! go get -d -u rsc.io/pdf
+[exec:git] stderr 'is a custom import path for'
+[exec:git] ! go get -d -f -u rsc.io/pdf
+[exec:git] stderr 'validating server certificate|[nN]ot [fF]ound'
+
+
+# Test that 'go get -u' reports moved Mercurial packages.
+
+[exec:hg] go get -d vcs-test.golang.org/go/custom-hg-hello
+[exec:hg] go get -d -u vcs-test.golang.org/go/custom-hg-hello
+[exec:hg] exec ./replace.exe custom-hg-hello vcs-test.golang.org/go/custom-hg-hello/.hg/hgrc
+
+[exec:hg] ! go get -d -u vcs-test.golang.org/go/custom-hg-hello
+[exec:hg] stderr 'is a custom import path for'
+[exec:hg] ! go get -d -f -u vcs-test.golang.org/go/custom-hg-hello
+[exec:hg] stderr 'validating server certificate|[nN]ot [fF]ound'
+
+
+-- replace/replace.go --
+package main
+
+import (
+ "bytes"
+ "io/ioutil"
+ "log"
+ "os"
+)
+
+func main() {
+ if len(os.Args) < 3 {
+ return
+ }
+
+ base := []byte(os.Args[1])
+ path := os.Args[2]
+ data, err := ioutil.ReadFile(path)
+ if err != nil {
+ log.Fatal(err)
+ }
+ err = ioutil.WriteFile(path, bytes.ReplaceAll(data, base, append(base, "XXX"...)), 0644)
+ if err != nil {
+ log.Fatal(err)
+ }
+}
diff --git a/libgo/go/cmd/go/testdata/script/gopath_paths.txt b/libgo/go/cmd/go/testdata/script/gopath_paths.txt
new file mode 100644
index 00000000000..04265b176f5
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/gopath_paths.txt
@@ -0,0 +1,43 @@
+# Regression test for GOPATH validation in GOPATH mode.
+env GO111MODULE=off
+
+env ORIG_GOPATH=$GOPATH
+
+# The literal path '.' in GOPATH should be rejected.
+env GOPATH=.
+! go build go-cmd-test/helloworld.go
+stderr 'GOPATH entry is relative'
+
+# It should still be rejected if the requested package can be
+# found using another entry.
+env GOPATH=${:}$ORIG_GOPATH${:}.
+! go build go-cmd-test
+stderr 'GOPATH entry is relative'
+
+# GOPATH cannot be a relative subdirectory of the working directory.
+env ORIG_GOPATH
+stdout 'ORIG_GOPATH='$WORK[/\\]gopath
+cd $WORK
+env GOPATH=gopath
+! go build gopath/src/go-cmd-test/helloworld.go
+stderr 'GOPATH entry is relative'
+
+# Blank paths in GOPATH should be rejected as relative (issue 21928).
+env GOPATH=' '${:}$ORIG_GOPATH
+! go build go-cmd-test
+stderr 'GOPATH entry is relative'
+
+[short] stop
+
+# Empty paths in GOPATH should be ignored (issue 21928).
+env GOPATH=${:}$ORIG_GOPATH
+env GOPATH
+go install go-cmd-test
+exists $ORIG_GOPATH/bin/go-cmd-test$GOEXE
+
+-- go-cmd-test/helloworld.go --
+package main
+
+func main() {
+ println("hello world")
+}
diff --git a/libgo/go/cmd/go/testdata/script/import_main.txt b/libgo/go/cmd/go/testdata/script/import_main.txt
new file mode 100644
index 00000000000..bc2cc4d3370
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/import_main.txt
@@ -0,0 +1,114 @@
+env GO111MODULE=off
+
+# Test that you cannot import a main package.
+# See golang.org/issue/4210 and golang.org/issue/17475.
+
+[short] skip
+cd $WORK
+
+# Importing package main from that package main's test should work.
+go build x
+go test -c x
+
+# Importing package main from another package should fail.
+! go build p1
+stderr 'import "x" is a program, not an importable package'
+
+# ... even in that package's test.
+go build p2
+! go test -c p2
+stderr 'import "x" is a program, not an importable package'
+
+# ... even if that package's test is an xtest.
+go build p3
+! go test p3
+stderr 'import "x" is a program, not an importable package'
+
+# ... even if that package is a package main
+go build p4
+! go test -c p4
+stderr 'import "x" is a program, not an importable package'
+
+# ... even if that package is a package main using an xtest.
+go build p5
+! go test -c p5
+stderr 'import "x" is a program, not an importable package'
+
+-- x/main.go --
+package main
+
+var X int
+
+func main() {}
+-- x/main_test.go --
+package main_test
+
+import (
+ "testing"
+ xmain "x"
+)
+
+var _ = xmain.X
+
+func TestFoo(t *testing.T) {}
+-- p1/p.go --
+package p1
+
+import xmain "x"
+
+var _ = xmain.X
+-- p2/p.go --
+package p2
+-- p2/p_test.go --
+package p2
+
+import (
+ "testing"
+ xmain "x"
+)
+
+var _ = xmain.X
+
+func TestFoo(t *testing.T) {}
+-- p3/p.go --
+package p
+-- p3/p_test.go --
+package p_test
+
+import (
+ "testing"
+ xmain "x"
+)
+
+var _ = xmain.X
+
+func TestFoo(t *testing.T) {}
+-- p4/p.go --
+package main
+
+func main() {}
+-- p4/p_test.go --
+package main
+
+import (
+ "testing"
+ xmain "x"
+)
+
+var _ = xmain.X
+
+func TestFoo(t *testing.T) {}
+-- p5/p.go --
+package main
+func main() {}
+-- p5/p_test.go --
+package main_test
+
+import (
+ "testing"
+ xmain "x"
+)
+
+var _ = xmain.X
+
+func TestFoo(t *testing.T) {}
diff --git a/libgo/go/cmd/go/testdata/script/install_cmd_gobin.txt b/libgo/go/cmd/go/testdata/script/install_cmd_gobin.txt
index 81649e234ff..4a5d8c8c627 100644
--- a/libgo/go/cmd/go/testdata/script/install_cmd_gobin.txt
+++ b/libgo/go/cmd/go/testdata/script/install_cmd_gobin.txt
@@ -1,6 +1,6 @@
# Check that commands in cmd are install to $GOROOT/bin, not $GOBIN.
# Verifies golang.org/issue/32674.
-[gccgo] stop
+[gccgo] skip
env GOBIN=gobin
mkdir gobin
go list -f '{{.Target}}' cmd/go
diff --git a/libgo/go/cmd/go/testdata/script/install_cross_gobin.txt b/libgo/go/cmd/go/testdata/script/install_cross_gobin.txt
index 60aeed689f3..14cf7222620 100644
--- a/libgo/go/cmd/go/testdata/script/install_cross_gobin.txt
+++ b/libgo/go/cmd/go/testdata/script/install_cross_gobin.txt
@@ -1,11 +1,10 @@
env GO111MODULE=off
[!short] skip # rebuilds std for alternate architecture
+[gccgo] skip
cd mycmd
go build mycmd
-[gccgo] stop
-
# cross-compile install with implicit GOBIN=$GOPATH/bin can make subdirectory
env GOARCH=386
[386] env GOARCH=amd64
diff --git a/libgo/go/cmd/go/testdata/script/link_syso_issue33139.txt b/libgo/go/cmd/go/testdata/script/link_syso_issue33139.txt
new file mode 100644
index 00000000000..c2ca27acbf9
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/link_syso_issue33139.txt
@@ -0,0 +1,43 @@
+# Test that we can use the external linker with a host syso file that is
+# embedded in a package, that is referenced by a Go assembly function.
+# See issue 33139.
+[!gc] skip
+[!exec:cc] skip
+
+# External linking is not supported on linux/ppc64.
+# See: https://github.com/golang/go/issues/8912
+[linux] [ppc64] skip
+
+# External linking is not supported on darwin/386 (10.14+).
+# See: https://github.com/golang/go/issues/31751
+[darwin] [386] skip
+
+cc -c -o syso/objTestImpl.syso syso/src/objTestImpl.c
+go build -ldflags='-linkmode=external' ./cmd/main.go
+
+-- syso/objTest.s --
+#include "textflag.h"
+
+TEXT ·ObjTest(SB), NOSPLIT, $0
+ // We do not actually execute this function in the test above, thus
+ // there is no stack frame setup here.
+ // We only care about Go build and/or link errors when referencing
+ // the objTestImpl symbol in the syso file.
+ JMP objTestImpl(SB)
+
+-- syso/pkg.go --
+package syso
+
+func ObjTest()
+
+-- syso/src/objTestImpl.c --
+void objTestImpl() { /* Empty */ }
+
+-- cmd/main.go --
+package main
+
+import "syso"
+
+func main() {
+ syso.ObjTest()
+}
diff --git a/libgo/go/cmd/go/testdata/script/list_ambiguous_path.txt b/libgo/go/cmd/go/testdata/script/list_ambiguous_path.txt
new file mode 100644
index 00000000000..bdb7ffb077a
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/list_ambiguous_path.txt
@@ -0,0 +1,38 @@
+# Ensures that we can correctly list package patterns ending in '.go'.
+# See golang.org/issue/34653.
+
+# A single pattern for a package ending in '.go'.
+go list ./foo.go
+stdout '^test/foo.go$'
+
+# Multiple patterns for packages including one ending in '.go'.
+go list ./bar ./foo.go
+stdout '^test/bar$'
+stdout '^test/foo.go$'
+
+# A single pattern for a Go file.
+go list ./a.go
+stdout '^command-line-arguments$'
+
+# A single typo-ed pattern for a Go file. This should
+# treat the wrong pattern as if it were a package.
+! go list ./foo.go/b.go
+stderr 'package ./foo.go/b.go: cannot find package "."'
+
+# Multiple patterns for Go files with a typo. This should
+# treat the wrong pattern as if it were a non-existint file.
+! go list ./foo.go/a.go ./foo.go/b.go
+[plan9] stderr 'stat ./foo.go/b.go: ''./foo.go/b.go'' does not exist'
+[windows] stderr './foo.go/b.go: The system cannot find the file specified'
+[!plan9] [!windows] stderr './foo.go/b.go: no such file or directory'
+
+-- a.go --
+package main
+-- bar/a.go --
+package bar
+-- foo.go/a.go --
+package foo.go
+-- go.mod --
+module "test"
+
+go 1.13
diff --git a/libgo/go/cmd/go/testdata/script/list_constraints.txt b/libgo/go/cmd/go/testdata/script/list_constraints.txt
new file mode 100644
index 00000000000..7115c365f05
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/list_constraints.txt
@@ -0,0 +1,86 @@
+# Check that files and their imports are not included in 'go list' output
+# when they are excluded by build constraints.
+
+# Linux and cgo files should be included when building in that configuration.
+env GOOS=linux
+env GOARCH=amd64
+env CGO_ENABLED=1
+go list -f '{{range .GoFiles}}{{.}} {{end}}'
+stdout '^cgotag.go empty.go suffix_linux.go tag.go $'
+go list -f '{{range .CgoFiles}}{{.}} {{end}}'
+stdout '^cgoimport.go $'
+go list -f '{{range .Imports}}{{.}} {{end}}'
+stdout '^C cgoimport cgotag suffix tag $'
+
+# Disabling cgo should exclude cgo files and their imports.
+env CGO_ENABLED=0
+go list -f '{{range .GoFiles}}{{.}} {{end}}'
+stdout 'empty.go suffix_linux.go tag.go'
+go list -f '{{range .CgoFiles}}{{.}} {{end}}'
+! stdout .
+go list -f '{{range .Imports}}{{.}} {{end}}'
+stdout '^suffix tag $'
+
+# Changing OS should exclude linux sources.
+env GOOS=darwin
+go list -f '{{range .GoFiles}}{{.}} {{end}}'
+stdout '^empty.go $'
+go list -f '{{range .Imports}}{{.}} {{end}}'
+stdout '^$'
+
+# Enabling a tag should include files that require it.
+go list -tags=extra -f '{{range .GoFiles}}{{.}} {{end}}'
+stdout '^empty.go extra.go $'
+go list -tags=extra -f '{{range .Imports}}{{.}} {{end}}'
+stdout '^extra $'
+
+# Packages that require a tag should not be listed unless the tag is on.
+! go list ./tagonly
+go list -tags=extra ./tagonly
+stdout m/tagonly
+
+-- go.mod --
+module m
+
+go 1.13
+
+-- empty.go --
+package p
+
+-- extra.go --
+// +build extra
+
+package p
+
+import _ "extra"
+
+-- suffix_linux.go --
+package p
+
+import _ "suffix"
+
+-- tag.go --
+// +build linux
+
+package p
+
+import _ "tag"
+
+-- cgotag.go --
+// +build cgo
+
+package p
+
+import _ "cgotag"
+
+-- cgoimport.go --
+package p
+
+import "C"
+
+import _ "cgoimport"
+
+-- tagonly/tagonly.go --
+// +build extra
+
+package tagonly
diff --git a/libgo/go/cmd/go/testdata/script/list_linkshared.txt b/libgo/go/cmd/go/testdata/script/list_linkshared.txt
new file mode 100644
index 00000000000..baae1e2be83
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/list_linkshared.txt
@@ -0,0 +1,16 @@
+env GO111MODULE=on
+
+# golang.org/issue/35759: 'go list -linkshared'
+# panicked if invoked on a test-only package.
+
+[!buildmode:shared] skip
+
+go list -f '{{.ImportPath}}: {{.Target}} {{.Shlib}}' -linkshared .
+stdout '^example.com: $'
+
+-- go.mod --
+module example.com
+
+go 1.14
+-- x.go --
+package x
diff --git a/libgo/go/cmd/go/testdata/script/list_parse_err.txt b/libgo/go/cmd/go/testdata/script/list_parse_err.txt
new file mode 100644
index 00000000000..5aacaa88fae
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/list_parse_err.txt
@@ -0,0 +1,17 @@
+# 'go list' should report imports, even if some files have parse errors
+# before the import block.
+go list -e -f '{{range .Imports}}{{.}} {{end}}'
+stdout '^fmt '
+
+-- go.mod --
+module m
+
+go 1.13
+
+-- a.go --
+package a
+
+import "fmt"
+
+-- b.go --
+// no package statement
diff --git a/libgo/go/cmd/go/testdata/script/list_split_main.txt b/libgo/go/cmd/go/testdata/script/list_split_main.txt
new file mode 100644
index 00000000000..74e7d5d74c2
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/list_split_main.txt
@@ -0,0 +1,25 @@
+# This test checks that a "main" package with an external test package
+# is recompiled only once.
+# Verifies golang.org/issue/34321.
+
+env GO111MODULE=off
+
+go list -e -test -deps -f '{{if not .Standard}}{{.ImportPath}}{{end}}' pkg
+cmp stdout want
+
+-- $GOPATH/src/pkg/pkg.go --
+package main
+
+func main() {}
+
+-- $GOPATH/src/pkg/pkg_test.go --
+package main
+
+import "testing"
+
+func Test(t *testing.T) {}
+
+-- want --
+pkg
+pkg [pkg.test]
+pkg.test
diff --git a/libgo/go/cmd/go/testdata/script/list_tags.txt b/libgo/go/cmd/go/testdata/script/list_tags.txt
deleted file mode 100644
index 49069bd2135..00000000000
--- a/libgo/go/cmd/go/testdata/script/list_tags.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-env GO111MODULE=off
-
-# go list supports -tags
-go list -tags=thetag ./my...
-stdout mypkg
-
--- mypkg/x.go --
-// +build thetag
-
-package mypkg
diff --git a/libgo/go/cmd/go/testdata/script/mod_ambiguous_import.txt b/libgo/go/cmd/go/testdata/script/mod_ambiguous_import.txt
new file mode 100644
index 00000000000..61e632a29cc
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_ambiguous_import.txt
@@ -0,0 +1,49 @@
+env GO111MODULE=on
+
+cd $WORK
+
+# An import provided by two different modules should be flagged as an error.
+! go build ./importx
+stderr '^importx[/\\]importx.go:2:8: ambiguous import: found package example.com/a/x in multiple modules:\n\texample.com/a v0.1.0 \('$WORK'[/\\]a[/\\]x\)\n\texample.com/a/x v0.1.0 \('$WORK'[/\\]ax\)$'
+
+# However, it should not be an error if that import is unused.
+go build ./importy
+
+# An import provided by both the main module and the vendor directory
+# should be flagged as an error only when -mod=vendor is set.
+# TODO: This error message is a bit redundant.
+mkdir vendor/example.com/m/importy
+cp $WORK/importy/importy.go vendor/example.com/m/importy/importy.go
+go build example.com/m/importy
+! go build -mod=vendor example.com/m/importy
+stderr '^can.t load package: package example.com/m/importy: ambiguous import: found package example.com/m/importy in multiple directories:\n\t'$WORK'[/\\]importy\n\t'$WORK'[/\\]vendor[/\\]example.com[/\\]m[/\\]importy$'
+
+-- $WORK/go.mod --
+module example.com/m
+go 1.13
+require (
+ example.com/a v0.1.0
+ example.com/a/x v0.1.0
+)
+replace (
+ example.com/a v0.1.0 => ./a
+ example.com/a/x v0.1.0 => ./ax
+)
+-- $WORK/importx/importx.go --
+package importx
+import _ "example.com/a/x"
+-- $WORK/importy/importy.go --
+package importy
+import _ "example.com/a/y"
+-- $WORK/a/go.mod --
+module example.com/a
+go 1.14
+-- $WORK/a/x/x.go --
+package x
+-- $WORK/a/y/y.go --
+package y
+-- $WORK/ax/go.mod --
+module example.com/a/x
+go 1.14
+-- $WORK/ax/x.go --
+package x
diff --git a/libgo/go/cmd/go/testdata/script/mod_auth.txt b/libgo/go/cmd/go/testdata/script/mod_auth.txt
index fe1d65794af..5bcbcd1a188 100644
--- a/libgo/go/cmd/go/testdata/script/mod_auth.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_auth.txt
@@ -8,6 +8,8 @@ env GOSUMDB=off
# basic auth should fail.
env NETRC=$WORK/empty
! go list all
+stderr '^\tserver response: ACCESS DENIED, buddy$'
+stderr '^\tserver response: File\? What file\?$'
# With credentials from a netrc file, it should succeed.
env NETRC=$WORK/netrc
diff --git a/libgo/go/cmd/go/testdata/script/mod_bad_domain.txt b/libgo/go/cmd/go/testdata/script/mod_bad_domain.txt
index c9fd044cdc8..ec0d474382e 100644
--- a/libgo/go/cmd/go/testdata/script/mod_bad_domain.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_bad_domain.txt
@@ -2,10 +2,16 @@ env GO111MODULE=on
# explicit get should report errors about bad names
! go get appengine
-stderr 'malformed module path "appengine": missing dot in first path element'
+stderr '^go get appengine: package appengine is not in GOROOT \(.*\)$'
! go get x/y.z
stderr 'malformed module path "x/y.z": missing dot in first path element'
+# 'go list -m' should report errors about module names, never GOROOT.
+! go list -m -versions appengine
+stderr 'malformed module path "appengine": missing dot in first path element'
+! go list -m -versions x/y.z
+stderr 'malformed module path "x/y.z": missing dot in first path element'
+
# build should report all unsatisfied imports,
# but should be more definitive about non-module import paths
! go build ./useappengine
diff --git a/libgo/go/cmd/go/testdata/script/mod_build_info_err.txt b/libgo/go/cmd/go/testdata/script/mod_build_info_err.txt
new file mode 100644
index 00000000000..87a099b219c
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_build_info_err.txt
@@ -0,0 +1,22 @@
+# This test verifies that line numbers are included in module import errors.
+# Verifies golang.org/issue/34393.
+
+go list -e -deps -f '{{with .Error}}{{.Pos}}: {{.Err}}{{end}}' ./main
+stdout 'bad[/\\]bad.go:3:8: malformed module path "🐧.example.com/string": invalid char ''🐧'''
+
+-- go.mod --
+module m
+
+go 1.13
+
+-- main/main.go --
+package main
+
+import _ "m/bad"
+
+func main() {}
+
+-- bad/bad.go --
+package bad
+
+import _ "🐧.example.com/string"
diff --git a/libgo/go/cmd/go/testdata/script/mod_cache_rw.txt b/libgo/go/cmd/go/testdata/script/mod_cache_rw.txt
new file mode 100644
index 00000000000..a5410764bc0
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_cache_rw.txt
@@ -0,0 +1,49 @@
+# Regression test for golang.org/issue/31481.
+
+env GO111MODULE=on
+
+# golang.org/issue/31481: an explicit flag should make directories in the module
+# cache writable in order to work around the historical inability of 'rm -rf' to
+# forcibly remove files in unwritable directories.
+go get -modcacherw -d rsc.io/quote@v1.5.2
+cp $WORK/extraneous.txt $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/extraneous_file.go
+
+# After adding an extraneous file, 'go mod verify' should fail.
+! go mod verify
+
+# However, files within those directories should still be read-only to avoid
+# accidental mutations.
+[!root] ! cp $WORK/extraneous.txt $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/go.mod
+
+# If all 'go' commands ran with the flag, the system's 'rm' binary
+# should be able to remove the module cache if the '-rf' flags are set.
+[!windows] [exec:rm] exec rm -rf $GOPATH/pkg/mod
+[!windows] [!exec:rm] go clean -modcache
+[windows] [exec:cmd.exe] exec cmd.exe /c rmdir /s /q $GOPATH\pkg\mod
+[windows] [!exec:cmd.exe] go clean -modcache
+! exists $GOPATH/pkg/mod
+
+# The directories in the module cache should by default be unwritable,
+# so that tests and tools will not accidentally add extraneous files to them.
+# Windows does not respect FILE_ATTRIBUTE_READONLY on directories, according
+# to MSDN, so there we disable testing whether the directory itself is
+# unwritable.
+go get -d rsc.io/quote@latest
+[!root] ! cp $WORK/extraneous.txt $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/go.mod
+[!windows] [!root] ! cp $WORK/extraneous.txt $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/extraneous_file.go
+! exists $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/extraneous_file.go
+
+
+# Repeat part of the test with 'go mod download' instead of 'go get' to verify
+# -modcacherw is supported on 'go mod' subcommands.
+go clean -modcache
+go mod download -modcacherw rsc.io/quote
+cp $WORK/extraneous.txt $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/extraneous_file.go
+! go mod verify
+[!root] ! cp $WORK/extraneous.txt $GOPATH/pkg/mod/rsc.io/quote@v1.5.2/go.mod
+
+
+-- $WORK/extraneous.txt --
+module oops
+-- go.mod --
+module golang.org/issue/31481
diff --git a/libgo/go/cmd/go/testdata/script/mod_convert_tsv_insecure.txt b/libgo/go/cmd/go/testdata/script/mod_convert_tsv_insecure.txt
new file mode 100644
index 00000000000..ddb0c081996
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_convert_tsv_insecure.txt
@@ -0,0 +1,27 @@
+env GO111MODULE=on
+
+[!net] skip
+[!exec:git] skip
+
+# secure fetch should report insecure warning
+cd $WORK/test
+go mod init
+stderr 'redirected .* to insecure URL'
+
+# insecure fetch should not
+env GOINSECURE=*.golang.org
+rm go.mod
+go mod init
+! stderr 'redirected .* to insecure URL'
+
+# insecure fetch invalid path should report insecure warning
+env GOINSECURE=foo.golang.org
+rm go.mod
+go mod init
+stderr 'redirected .* to insecure URL'
+
+-- $WORK/test/dependencies.tsv --
+vcs-test.golang.org/insecure/go/insecure git 6fecd21f7c0c 2019-09-04T18:39:48Z
+
+-- $WORK/test/x.go --
+package x // import "m"
diff --git a/libgo/go/cmd/go/testdata/script/mod_convert_vendor_json.txt b/libgo/go/cmd/go/testdata/script/mod_convert_vendor_json.txt
index 47d111d4c13..df6db36574f 100644
--- a/libgo/go/cmd/go/testdata/script/mod_convert_vendor_json.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_convert_vendor_json.txt
@@ -10,7 +10,7 @@ stderr '\s*cd \.\. && go mod init'
# The command we suggested should succeed.
cd ..
go mod init
-go list -m all
+go list -m
stdout '^m$'
-- $WORK/test/vendor/vendor.json --
diff --git a/libgo/go/cmd/go/testdata/script/mod_convert_vendor_manifest.txt b/libgo/go/cmd/go/testdata/script/mod_convert_vendor_manifest.txt
index 68edb9dc292..8b6a1414be2 100644
--- a/libgo/go/cmd/go/testdata/script/mod_convert_vendor_manifest.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_convert_vendor_manifest.txt
@@ -10,7 +10,7 @@ stderr '\s*cd \.\. && go mod init'
# The command we suggested should succeed.
cd ..
go mod init
-go list -m all
+go list -m
stdout '^m$'
-- $WORK/test/vendor/manifest --
diff --git a/libgo/go/cmd/go/testdata/script/mod_doc.txt b/libgo/go/cmd/go/testdata/script/mod_doc.txt
index d7aa553c1d3..aac3db00be1 100644
--- a/libgo/go/cmd/go/testdata/script/mod_doc.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_doc.txt
@@ -36,6 +36,35 @@ go doc rsc.io/quote
! stdout 'Package quote is located in a GOPATH workspace.'
stdout 'Package quote collects pithy sayings.'
+# Check that a sensible error message is printed when a package is not found.
+env GOPROXY=off
+! go doc example.com/hello
+stderr '^doc: cannot find module providing package example.com/hello: module lookup disabled by GOPROXY=off$'
+
+# When in a module with a vendor directory, doc should use the vendored copies
+# of the packages. 'std' and 'cmd' are convenient examples of such modules.
+#
+# When in those modules, the "// import" comment should refer to the same import
+# path used in source code, not to the absolute path relative to GOROOT.
+
+cd $GOROOT/src
+go doc cryptobyte
+stdout '// import "golang.org/x/crypto/cryptobyte"'
+
+cd $GOROOT/src/cmd/go
+go doc modfile
+stdout '// import "golang.org/x/mod/modfile"'
+
+# When outside of the 'std' module, its vendored packages
+# remain accessible using the 'vendor/' prefix, but report
+# the correct "// import" comment as used within std.
+cd $GOPATH
+go doc vendor/golang.org/x/crypto/cryptobyte
+stdout '// import "vendor/golang.org/x/crypto/cryptobyte"'
+
+go doc cmd/vendor/golang.org/x/mod/modfile
+stdout '// import "cmd/vendor/golang.org/x/mod/modfile"'
+
-- go.mod --
module x
require rsc.io/quote v1.5.2
diff --git a/libgo/go/cmd/go/testdata/script/mod_download.txt b/libgo/go/cmd/go/testdata/script/mod_download.txt
index 9eb3140c332..3573928a933 100644
--- a/libgo/go/cmd/go/testdata/script/mod_download.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_download.txt
@@ -4,6 +4,7 @@ env GOPROXY=$GOPROXY/quiet
# download with version should print nothing
go mod download rsc.io/quote@v1.5.0
! stdout .
+! stderr .
exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.info
exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.mod
@@ -17,7 +18,6 @@ stderr 'this.domain.is.invalid'
stdout '"Error": ".*this.domain.is.invalid.*"'
# download -json with version should print JSON
-# and download the .info file for the 'latest' version.
go mod download -json 'rsc.io/quote@<=v1.5.0'
stdout '^\t"Path": "rsc.io/quote"'
stdout '^\t"Version": "v1.5.0"'
@@ -28,14 +28,13 @@ stdout '^\t"Sum": "h1:6fJa6E\+wGadANKkUMlZ0DhXFpoKlslOQDCo259XtdIE="' # hash of
stdout '^\t"GoModSum": "h1:LzX7hefJvL54yjefDEDHNONDjII0t9xZLPXsUe\+TKr0="'
! stdout '"Error"'
-exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.info
-
# download queries above should not have added to go.mod.
go list -m all
! stdout rsc.io
# add to go.mod so we can test non-query downloads
go mod edit -require rsc.io/quote@v1.5.2
+! exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.info
! exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.mod
! exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.zip
@@ -95,6 +94,12 @@ stderr '^rsc.io/quote@v1.999.999: reading .*/v1.999.999.info: 404 Not Found$'
! go mod download -json bad/path
stdout '^\t"Error": "module bad/path: not a known dependency"'
+# download main module returns an error
+go mod download m
+stderr '^go mod download: skipping argument m that resolves to the main module\n'
+go mod download m@latest
+stderr '^go mod download: skipping argument m@latest that resolves to the main module\n'
+
# allow go mod download without go.mod
env GO111MODULE=auto
rm go.mod
@@ -102,5 +107,11 @@ rm $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.2.1.zip
go mod download rsc.io/quote@v1.2.1
exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.2.1.zip
+# download -x with version should print
+# the underlying commands such as contacting GOPROXY.
+go mod download -x rsc.io/quote@v1.0.0
+! stdout .
+stderr 'get '$GOPROXY
+
-- go.mod --
module m
diff --git a/libgo/go/cmd/go/testdata/script/mod_download_json.txt b/libgo/go/cmd/go/testdata/script/mod_download_json.txt
new file mode 100644
index 00000000000..01c35dd9937
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_download_json.txt
@@ -0,0 +1,10 @@
+env GO111MODULE=on
+env GOPROXY=$GOPROXY/quiet
+env GOSUMDB=$sumdb' '$proxy/sumdb-wrong
+
+# download -json with version should print JSON on sumdb failure
+! go mod download -json 'rsc.io/quote@<=v1.5.0'
+stdout '"Error": ".*verifying module'
+
+-- go.mod --
+module m
diff --git a/libgo/go/cmd/go/testdata/script/mod_download_latest.txt b/libgo/go/cmd/go/testdata/script/mod_download_latest.txt
deleted file mode 100644
index 60d860e4da4..00000000000
--- a/libgo/go/cmd/go/testdata/script/mod_download_latest.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-env GO111MODULE=on
-
-# If the module is the latest version of itself,
-# the Latest field should be set.
-go mod download -json rsc.io/quote@v1.5.2
-stdout '"Latest":\s*true'
-
-# If the module is older than latest, the field should be unset.
-go mod download -json rsc.io/quote@v1.5.1
-! stdout '"Latest":'
-
-# If the module is newer than "latest", the field should be unset...
-go mod download -json rsc.io/quote@v1.5.3-pre1
-! stdout '"Latest":'
-
-# ...even if that version is also what is required by the main module.
-go mod init example.com
-go mod edit -require rsc.io/quote@v1.5.3-pre1
-go mod download -json rsc.io/quote@v1.5.3-pre1
-! stdout '"Latest":'
diff --git a/libgo/go/cmd/go/testdata/script/mod_download_replace_file.txt b/libgo/go/cmd/go/testdata/script/mod_download_replace_file.txt
new file mode 100644
index 00000000000..f6ab4fe91f0
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_download_replace_file.txt
@@ -0,0 +1,16 @@
+# This test checks that 'go mod download' produces no output for
+# the main module (when specified implicitly) and for a module replaced
+# with a file path.
+# Verifies golang.org/issue/35505.
+go mod download -json all
+cmp stdout no-output
+
+-- go.mod --
+module example.com/a
+
+require example.com/b v1.0.0
+
+replace example.com/b => ./local/b
+-- local/b/go.mod --
+module example.com/b
+-- no-output --
diff --git a/libgo/go/cmd/go/testdata/script/mod_edit.txt b/libgo/go/cmd/go/testdata/script/mod_edit.txt
index 42007b13d09..898d8524acf 100644
--- a/libgo/go/cmd/go/testdata/script/mod_edit.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_edit.txt
@@ -52,6 +52,12 @@ go mod init a.a/b/c
go mod edit -module x.x/y/z
cmpenv go.mod go.mod.edit
+# golang.org/issue/30513: don't require go-gettable module paths.
+cd $WORK/local
+go mod init foo
+go mod edit -module local-only -require=other-local@v1.0.0 -replace other-local@v1.0.0=./other
+cmpenv go.mod go.mod.edit
+
-- x.go --
package x
@@ -159,6 +165,14 @@ exclude x.1 v1.2.0
replace x.1 => y.1/v2 v2.3.6
require x.3 v1.99.0
+-- $WORK/local/go.mod.edit --
+module local-only
+
+go $goversion
+
+require other-local v1.0.0
+
+replace other-local v1.0.0 => ./other
-- $WORK/go.mod.badfmt --
module x.x/y/z
diff --git a/libgo/go/cmd/go/testdata/script/mod_edit_go.txt b/libgo/go/cmd/go/testdata/script/mod_edit_go.txt
index 428510293f0..0f4e093573e 100644
--- a/libgo/go/cmd/go/testdata/script/mod_edit_go.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_edit_go.txt
@@ -1,6 +1,6 @@
# Test support for go mod -edit to set language version.
-[gccgo] stop
+[gccgo] skip
env GO111MODULE=on
! go build
diff --git a/libgo/go/cmd/go/testdata/script/mod_empty_err.txt b/libgo/go/cmd/go/testdata/script/mod_empty_err.txt
new file mode 100644
index 00000000000..729f848156d
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_empty_err.txt
@@ -0,0 +1,36 @@
+# This test checks error messages for non-existant packages in module mode.
+# Veries golang.org/issue/35414
+env GO111MODULE=on
+cd $WORK
+
+go list -e -f {{.Error}} .
+stdout 'package \.: no Go files in \$WORK'
+
+go list -e -f {{.Error}} ./empty
+stdout 'package \./empty: no Go files in \$WORK[/\\]empty'
+
+go list -e -f {{.Error}} ./exclude
+stdout 'package \./exclude: build constraints exclude all Go files in \$WORK[/\\]exclude'
+
+go list -e -f {{.Error}} ./missing
+stdout 'package \./missing: cannot find package "." in:\s*\$WORK[/\\]missing'
+
+# use 'go build -n' because 'go list' reports no error.
+! go build -n ./testonly
+stderr 'example.com/m/testonly: no non-test Go files in \$WORK[/\\]testonly'
+
+-- $WORK/go.mod --
+module example.com/m
+
+go 1.14
+
+-- $WORK/empty/empty.txt --
+-- $WORK/exclude/exclude.go --
+// +build exclude
+
+package exclude
+-- $WORK/testonly/testonly_test.go --
+package testonly_test
+-- $WORK/excluded-stdout --
+package ./excluded: cannot find package "." in:
+ $WORK/excluded
diff --git a/libgo/go/cmd/go/testdata/script/mod_fs_patterns.txt b/libgo/go/cmd/go/testdata/script/mod_fs_patterns.txt
index fd7de130024..4911fbb6138 100644
--- a/libgo/go/cmd/go/testdata/script/mod_fs_patterns.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_fs_patterns.txt
@@ -1,7 +1,6 @@
-# File system pattern searches should skip sub-modules and vendor directories.
-
env GO111MODULE=on
+# File system pattern searches should skip sub-modules and vendor directories.
cd x
# all packages
@@ -40,6 +39,24 @@ stderr '^can.t load package: package ./nonexist: cannot find package "." in:\n\t
! stderr 'import lookup disabled'
stderr 'can.t load package: package ./go.mod: cannot find package'
+
+# File system paths and patterns should allow the '@' character.
+cd ../@at
+go list $PWD
+stdout '^at$'
+go list $PWD/...
+stdout '^at$'
+
+# The '@' character is not allowed in directory paths that are part of
+# a package path.
+cd ../badat/bad@
+! go list .
+stderr 'directory . outside available modules'
+! go list $PWD
+stderr 'directory . outside available modules'
+! go list $PWD/...
+stderr 'directory . outside available modules'
+
-- x/go.mod --
module m
@@ -64,3 +81,17 @@ package z
-- x/y/z/w/w.go --
package w
+
+-- @at/go.mod --
+module at
+
+go 1.14
+-- @at/at.go --
+package at
+
+-- badat/go.mod --
+module badat
+
+go 1.14
+-- badat/bad@/bad.go --
+package bad
diff --git a/libgo/go/cmd/go/testdata/script/mod_get_direct.txt b/libgo/go/cmd/go/testdata/script/mod_get_direct.txt
new file mode 100644
index 00000000000..42ccbcd38a1
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_get_direct.txt
@@ -0,0 +1,20 @@
+# Regression test for golang.org/issue/34092: with an empty module cache,
+# 'GOPROXY=direct go get golang.org/x/tools/gopls@master' did not correctly
+# resolve the pseudo-version for its dependency on golang.org/x/tools.
+
+[short] skip
+[!net] skip
+[!exec:git] skip
+
+env GO111MODULE=on
+env GOPROXY=direct
+env GOSUMDB=off
+
+go list -m cloud.google.com/go@master
+! stdout 'v0.0.0-'
+
+-- go.mod --
+module example.com
+
+go 1.14
+-- go.sum --
diff --git a/libgo/go/cmd/go/testdata/script/mod_get_insecure_redirect.txt b/libgo/go/cmd/go/testdata/script/mod_get_insecure_redirect.txt
new file mode 100644
index 00000000000..3755f176332
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_get_insecure_redirect.txt
@@ -0,0 +1,34 @@
+# golang.org/issue/29591: 'go get' was following plain-HTTP redirects even without -insecure.
+
+[!net] skip
+[!exec:git] skip
+
+env GO111MODULE=on
+env GOPROXY=direct
+env GOSUMDB=off
+
+! go get -d vcs-test.golang.org/insecure/go/insecure
+stderr 'redirected .* to insecure URL'
+
+go get -d -insecure vcs-test.golang.org/insecure/go/insecure
+
+# insecure host
+env GOINSECURE=vcs-test.golang.org
+go clean -modcache
+go get -d vcs-test.golang.org/insecure/go/insecure
+
+# insecure glob host
+env GOINSECURE=*.golang.org
+go clean -modcache
+go get -d vcs-test.golang.org/insecure/go/insecure
+
+# insecure multiple host
+env GOINSECURE=somewhere-else.com,*.golang.org
+go clean -modcache
+go get -d vcs-test.golang.org/insecure/go/insecure
+
+# different insecure host does not fetch
+env GOINSECURE=somewhere-else.com
+go clean -modcache
+! go get -d vcs-test.golang.org/insecure/go/insecure
+stderr 'redirected .* to insecure URL'
diff --git a/libgo/go/cmd/go/testdata/script/mod_get_major.txt b/libgo/go/cmd/go/testdata/script/mod_get_major.txt
new file mode 100644
index 00000000000..367ede9ded4
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_get_major.txt
@@ -0,0 +1,23 @@
+[!net] skip
+[!exec:git] skip
+
+env GO111MODULE=on
+env GOPROXY=direct
+env GOSUMDB=off
+
+# golang.org/issue/34383: if a module path ends in a major-version suffix,
+# ensure that 'direct' mode can resolve the package to a module.
+
+go get -d vcs-test.golang.org/git/v3pkg.git/v3@v3.0.0
+
+go list -m vcs-test.golang.org/git/v3pkg.git/v3
+stdout '^vcs-test.golang.org/git/v3pkg.git/v3 v3.0.0$'
+
+go get -d vcs-test.golang.org/git/empty-v2-without-v1.git/v2@v2.0.0
+
+go list -m vcs-test.golang.org/git/empty-v2-without-v1.git/v2
+stdout '^vcs-test.golang.org/git/empty-v2-without-v1.git/v2 v2.0.0$'
+
+-- go.mod --
+module example.com
+go 1.13
diff --git a/libgo/go/cmd/go/testdata/script/mod_get_newcycle.txt b/libgo/go/cmd/go/testdata/script/mod_get_newcycle.txt
index b1838f824a6..5c197bb0b82 100644
--- a/libgo/go/cmd/go/testdata/script/mod_get_newcycle.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_get_newcycle.txt
@@ -11,6 +11,5 @@ go mod init m
cmp stderr stderr-expected
-- stderr-expected --
-go: finding example.com/newcycle v1.0.0
go get: inconsistent versions:
example.com/newcycle/a@v1.0.0 requires example.com/newcycle/a@v1.0.1 (not example.com/newcycle/a@v1.0.0)
diff --git a/libgo/go/cmd/go/testdata/script/mod_get_patterns.txt b/libgo/go/cmd/go/testdata/script/mod_get_patterns.txt
index bfab70090cf..8adc4b0c065 100644
--- a/libgo/go/cmd/go/testdata/script/mod_get_patterns.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_get_patterns.txt
@@ -10,11 +10,11 @@ grep 'require rsc.io/quote' go.mod
cp go.mod.orig go.mod
! go get -d rsc.io/quote/x...
-stderr 'go get rsc.io/quote/x...: module rsc.io/quote@upgrade \(v1.5.2\) found, but does not contain packages matching rsc.io/quote/x...'
+stderr 'go get rsc.io/quote/x...: module rsc.io/quote@upgrade found \(v1.5.2\), but does not contain packages matching rsc.io/quote/x...'
! grep 'require rsc.io/quote' go.mod
! go get -d rsc.io/quote/x/...
-stderr 'go get rsc.io/quote/x/...: module rsc.io/quote@upgrade \(v1.5.2\) found, but does not contain packages matching rsc.io/quote/x/...'
+stderr 'go get rsc.io/quote/x/...: module rsc.io/quote@upgrade found \(v1.5.2\), but does not contain packages matching rsc.io/quote/x/...'
! grep 'require rsc.io/quote' go.mod
# If a pattern matches no packages within a module, the module should not
diff --git a/libgo/go/cmd/go/testdata/script/mod_get_svn.txt b/libgo/go/cmd/go/testdata/script/mod_get_svn.txt
index cd19d99dbcc..3817fce9b61 100644
--- a/libgo/go/cmd/go/testdata/script/mod_get_svn.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_get_svn.txt
@@ -1,17 +1,27 @@
[!net] skip
[!exec:svn] skip
+# 'go get' will fall back to svn+ssh once svn fails over protocols like https.
+# If vcs-test.golang.org isn't in the user's known_hosts file, this will result
+# in an ssh prompt, which will stop 'go test' entirely
+#
+# Unfortunately, there isn't a way to globally disable host checking for ssh,
+# without modifying the real system's or user's configs. Changing $HOME won't
+# affect ssh either, as it ignores the environment variable entirely.
+#
+# However, a useful trick is pointing SVN_SSH to a program that doesn't exist,
+# resulting in svn skipping ssh entirely. Alternatives like
+# SVN_SSH="ssh -o StrictHostKeyChecking=no" didn't avoid the prompt.
+env SVN_SSH="svn_do_not_use_ssh"
+
env GO111MODULE=on
env GOPROXY=direct
env GOSUMDB=off
-# Attempting to get a module zip using svn should fail with a reasonable
-# message instead of a panic.
-# TODO(golang.org/issue/26092): Really, it shouldn't fail at all.
-! go get -d vcs-test.golang.org/svn/hello.svn
-stderr 'ReadZip not implemented for svn'
-! go install .
-stderr 'ReadZip not implemented for svn'
+# Attempting to get a module zip using svn should succeed.
+go get vcs-test.golang.org/svn/hello.svn@000000000001
+exists $GOPATH/pkg/mod/cache/download/vcs-test.golang.org/svn/hello.svn/@v/v0.0.0-20170922011245-000000000001.zip
+exists $GOPATH/bin/hello.svn$GOEXE
# Attempting to get a nonexistent module using svn should fail with a
# reasonable message instead of a panic.
@@ -21,7 +31,6 @@ stderr 'go get vcs-test.golang.org/svn/nonexistent.svn: no matching versions for
-- go.mod --
module golang/go/issues/28943/main
--- main.go --
-package main
-import _ "vcs-test.golang.org/svn/hello.svn"
-func main() {}
+-- go.sum --
+vcs-test.golang.org/svn/hello.svn v0.0.0-20170922011245-000000000001 h1:rZjvboXMfQICKXdhx/QHqJ2Y/AQsJVrXnwGqwcTxQiw=
+vcs-test.golang.org/svn/hello.svn v0.0.0-20170922011245-000000000001/go.mod h1:0memnh/BRLuxiK2zF4rvUgz6ts/fhhB28l3ULFWPusc=
diff --git a/libgo/go/cmd/go/testdata/script/mod_get_trailing_slash.txt b/libgo/go/cmd/go/testdata/script/mod_get_trailing_slash.txt
new file mode 100644
index 00000000000..7b5d90c50b5
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_get_trailing_slash.txt
@@ -0,0 +1,30 @@
+# go list should succeed to load a package ending with ".go" if the path does
+# not correspond to an existing local file. Listing a pattern ending with
+# ".go/" should try to list a package regardless of whether a file exists at the
+# path without the suffixed "/" or not.
+go list example.com/dotgo.go
+stdout ^example.com/dotgo.go$
+go list example.com/dotgo.go/
+stdout ^example.com/dotgo.go$
+
+# go get -d should succeed in either case, with or without a version.
+# Arguments are interpreted as packages or package patterns with versions,
+# not source files.
+go get -d example.com/dotgo.go
+go get -d example.com/dotgo.go/
+go get -d example.com/dotgo.go@v1.0.0
+go get -d example.com/dotgo.go/@v1.0.0
+
+# go get (without -d) should also succeed in either case.
+[short] skip
+go get example.com/dotgo.go
+go get example.com/dotgo.go/
+go get example.com/dotgo.go@v1.0.0
+go get example.com/dotgo.go/@v1.0.0
+
+-- go.mod --
+module m
+
+go 1.13
+
+require example.com/dotgo.go v1.0.0
diff --git a/libgo/go/cmd/go/testdata/script/mod_getmode_vendor.txt b/libgo/go/cmd/go/testdata/script/mod_getmode_vendor.txt
index 7e1f6aa323e..d3df2078b07 100644
--- a/libgo/go/cmd/go/testdata/script/mod_getmode_vendor.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_getmode_vendor.txt
@@ -6,14 +6,21 @@ env GOPATH=$WORK/empty
env GOPROXY=file:///nonexist
go list -mod=vendor
-go list -mod=vendor -m -f '{{.Path}} {{.Version}} {{.Dir}}' all
+go list -mod=vendor -f '{{with .Module}}{{.Path}} {{.Version}}{{end}} {{.Dir}}' all
stdout '^rsc.io/quote v1.5.1 .*vendor[\\/]rsc.io[\\/]quote$'
-stdout '^golang.org/x/text v0.0.0.* .*vendor[\\/]golang.org[\\/]x[\\/]text$'
+stdout '^golang.org/x/text v0.0.0.* .*vendor[\\/]golang.org[\\/]x[\\/]text[\\/]language$'
! go list -mod=vendor -m rsc.io/quote@latest
-stderr 'module lookup disabled by -mod=vendor'
+stderr 'go list -m: rsc.io/quote@latest: cannot query module due to -mod=vendor'
! go get -mod=vendor -u
-stderr 'go get: disabled by -mod=vendor'
+stderr 'flag provided but not defined: -mod'
+
+# Since we don't have a complete module graph, 'go list -m' queries
+# that require the complete graph should fail with a useful error.
+! go list -mod=vendor -m all
+stderr 'go list -m: can''t compute ''all'' using the vendor directory\n\t\(Use -mod=mod or -mod=readonly to bypass.\)'
+! go list -mod=vendor -m ...
+stderr 'go list -m: can''t match module patterns using the vendor directory\n\t\(Use -mod=mod or -mod=readonly to bypass.\)'
-- go.mod --
module x
diff --git a/libgo/go/cmd/go/testdata/script/mod_getx.txt b/libgo/go/cmd/go/testdata/script/mod_getx.txt
new file mode 100644
index 00000000000..ccb8d1375aa
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_getx.txt
@@ -0,0 +1,14 @@
+[short] skip
+[!net] skip
+[!exec:git] skip
+
+env GO111MODULE=on
+env GOPROXY=direct
+env GOSUMDB=off
+
+# 'go get -x' should log URLs with an HTTP or HTTPS scheme.
+# A bug had caused us to log schemeless URLs instead.
+go get -x -d golang.org/x/text@v0.1.0
+stderr '^# get https://golang.org/x/text\?go-get=1$'
+stderr '^# get https://golang.org/x/text\?go-get=1: 200 OK \([0-9.]+s\)$'
+! stderr '^# get //.*'
diff --git a/libgo/go/cmd/go/testdata/script/mod_go_version_mixed.txt b/libgo/go/cmd/go/testdata/script/mod_go_version_mixed.txt
new file mode 100644
index 00000000000..d6216ae2443
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_go_version_mixed.txt
@@ -0,0 +1,43 @@
+# Test that dependencies can use Go language features newer than the
+# Go version specified by the main module.
+
+env GO111MODULE=on
+
+go build
+
+-- go.mod --
+module m
+go 1.12
+require (
+ sub.1 v1.0.0
+)
+replace (
+ sub.1 => ./sub
+)
+
+-- x.go --
+package x
+
+import "sub.1"
+
+func F() { sub.F(0, 0) }
+
+var A sub.Alias
+var D sub.Defined
+
+-- sub/go.mod --
+module m
+go 1.14
+
+-- sub/sub.go --
+package sub
+
+// signed shift counts added in Go 1.13
+func F(l, r int) int { return l << r }
+
+type m1 interface { M() }
+type m2 interface { M() }
+
+// overlapping interfaces added in Go 1.14
+type Alias = interface { m1; m2; M() }
+type Defined interface { m1; m2; M() }
diff --git a/libgo/go/cmd/go/testdata/script/mod_goroot_errors.txt b/libgo/go/cmd/go/testdata/script/mod_goroot_errors.txt
new file mode 100644
index 00000000000..2e08ae03aa3
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_goroot_errors.txt
@@ -0,0 +1,55 @@
+env GO111MODULE=on
+
+[gccgo] skip
+
+# Regression test for https://golang.org/issue/34769.
+# Missing standard-library imports should refer to GOROOT rather than
+# complaining about a malformed module path.
+# This is especially important when GOROOT is set incorrectly,
+# since such an error will occur for every package in std.
+
+# Building a nonexistent std package directly should fail usefully.
+
+! go build -mod=readonly nonexist
+! stderr 'import lookup disabled'
+! stderr 'missing dot'
+stderr '^can''t load package: package nonexist is not in GOROOT \('$GOROOT'[/\\]src[/\\]nonexist\)$'
+
+! go build nonexist
+! stderr 'import lookup disabled'
+! stderr 'missing dot'
+stderr '^can''t load package: package nonexist is not in GOROOT \('$GOROOT'[/\\]src[/\\]nonexist\)$'
+
+# Building a nonexistent std package indirectly should also fail usefully.
+
+! go build -mod=readonly ./importnonexist
+! stderr 'import lookup disabled'
+! stderr 'missing dot'
+stderr '^importnonexist[/\\]x.go:2:8: package nonexist is not in GOROOT \('$GOROOT'[/\\]src[/\\]nonexist\)$'
+
+! go build ./importnonexist
+! stderr 'import lookup disabled'
+! stderr 'missing dot'
+stderr '^importnonexist[/\\]x.go:2:8: package nonexist is not in GOROOT \('$GOROOT'[/\\]src[/\\]nonexist\)$'
+
+# Building an *actual* std package should fail if GOROOT is set to something bogus.
+
+[!short] go build ./importjson # Prove that it works when GOROOT is valid.
+
+env GOROOT=$WORK/not-a-valid-goroot
+! go build ./importjson
+! stderr 'import lookup disabled'
+! stderr 'missing dot'
+stderr 'importjson[/\\]x.go:2:8: package encoding/json is not in GOROOT \('$WORK'[/\\]not-a-valid-goroot[/\\]src[/\\]encoding[/\\]json\)$'
+
+-- go.mod --
+module example.com
+go 1.14
+-- importnonexist/x.go --
+package importnonexist
+import _ "nonexist"
+-- importjson/x.go --
+package importjson
+import _ "encoding/json"
+-- $WORK/not-a-valid-goroot/README --
+This directory is not a valid GOROOT.
diff --git a/libgo/go/cmd/go/testdata/script/mod_in_testdata_dir.txt b/libgo/go/cmd/go/testdata/script/mod_in_testdata_dir.txt
new file mode 100644
index 00000000000..f582569798b
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_in_testdata_dir.txt
@@ -0,0 +1,45 @@
+# Regression test for golang.org/issue/28481:
+# 'mod tidy' removed dependencies if the module root was
+# within a directory named 'testdata' or '_foo'.
+
+env GO111MODULE=on
+
+# A module should be allowed in a directory named testdata.
+cd $WORK/testdata
+go mod init testdata.tld/foo
+
+# Building a package within that module should resolve its dependencies.
+go build
+grep 'rsc.io/quote' go.mod
+
+# Tidying the module should preserve those dependencies.
+go mod tidy
+grep 'rsc.io/quote' go.mod
+
+[short] stop
+
+# Vendoring the module's dependencies should work too.
+go mod vendor
+exists vendor/rsc.io/quote
+
+# The same should work in directories with names starting with underscores.
+cd $WORK/_ignored
+go mod init testdata.tld/foo
+
+go build
+grep 'rsc.io/quote' go.mod
+
+go mod tidy
+grep 'rsc.io/quote' go.mod
+
+go mod vendor
+exists vendor/rsc.io/quote
+
+-- $WORK/testdata/main.go --
+package foo
+
+import _ "rsc.io/quote"
+-- $WORK/_ignored/main.go --
+package foo
+
+import _ "rsc.io/quote"
diff --git a/libgo/go/cmd/go/testdata/script/mod_internal.txt b/libgo/go/cmd/go/testdata/script/mod_internal.txt
index 5a361a4f424..1193d528ece 100644
--- a/libgo/go/cmd/go/testdata/script/mod_internal.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_internal.txt
@@ -2,8 +2,7 @@ env GO111MODULE=on
[short] skip
# golang.org/x/internal should be importable from other golang.org/x modules.
-rm go.mod
-go mod init golang.org/x/anything
+go mod edit -module=golang.org/x/anything
go build .
# ...and their tests...
@@ -20,8 +19,7 @@ stderr 'use of internal package golang.org/x/.* not allowed'
stderr 'use of internal package internal/testenv not allowed'
# Dependencies should be able to use their own internal modules...
-rm go.mod
-go mod init golang.org/notx
+go mod edit -module=golang.org/notx
go build ./throughdep
# ... but other modules should not, even if they have transitive dependencies.
@@ -34,8 +32,7 @@ stderr golang.org[/\\]notx[/\\]useinternal
stderr 'use of internal package golang.org/x/.* not allowed'
# Replacing an internal module should keep it internal to the same paths.
-rm go.mod
-go mod init golang.org/notx
+go mod edit -module=golang.org/notx
go mod edit -replace golang.org/x/internal=./replace/golang.org/notx/internal
go build ./throughdep
@@ -50,6 +47,9 @@ go build ./throughdep
stderr golang.org[/\\]notx[/\\]useinternal
stderr 'use of internal package golang.org/x/.* not allowed'
+-- go.mod --
+module TBD
+go 1.12
-- useinternal.go --
package useinternal
import _ "golang.org/x/internal/subtle"
diff --git a/libgo/go/cmd/go/testdata/script/mod_issue35317.txt b/libgo/go/cmd/go/testdata/script/mod_issue35317.txt
new file mode 100644
index 00000000000..92416a54e47
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_issue35317.txt
@@ -0,0 +1,8 @@
+# Regression test for golang.org/issue/35317:
+# 'go get' with multiple module-only arguments was racy.
+
+env GO111MODULE=on
+[short] skip
+
+go mod init example.com
+go get golang.org/x/text@v0.3.0 golang.org/x/internal@v0.1.0 golang.org/x/exp@none
diff --git a/libgo/go/cmd/go/testdata/script/mod_list_dir.txt b/libgo/go/cmd/go/testdata/script/mod_list_dir.txt
index a8023cce9c5..f6994c1e666 100644
--- a/libgo/go/cmd/go/testdata/script/mod_list_dir.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_list_dir.txt
@@ -12,10 +12,10 @@ stdout ^math$
go list -f '{{.ImportPath}}' .
stdout ^x$
! go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2
-stderr '^can.t load package: package '$WORK'[/\\]gopath/pkg/mod/rsc.io/quote@v1.5.2: can only use path@version syntax with .go get.'
+stderr '^can.t load package: package '$WORK'[/\\]gopath[/\\]pkg[/\\]mod[/\\]rsc.io[/\\]quote@v1.5.2: can only use path@version syntax with .go get.'
go list -e -f '{{with .Error}}{{.}}{{end}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2
-stdout '^package '$WORK'[/\\]gopath/pkg/mod/rsc.io/quote@v1.5.2: can only use path@version syntax with .go get.'
+stdout '^package '$WORK'[/\\]gopath[/\\]pkg[/\\]mod[/\\]rsc.io[/\\]quote@v1.5.2: can only use path@version syntax with .go get.'
go mod download rsc.io/quote@v1.5.2
go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2
stdout '^rsc.io/quote$'
diff --git a/libgo/go/cmd/go/testdata/script/mod_list_e_readonly.txt b/libgo/go/cmd/go/testdata/script/mod_list_e_readonly.txt
new file mode 100644
index 00000000000..4969434e52b
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_list_e_readonly.txt
@@ -0,0 +1,15 @@
+# 'go list -mod=readonly -e should attribute errors
+# to individual missing packages.
+# Verifies golang.org/issue/34829.
+go list -mod=readonly -e -deps -f '{{if .Error}}{{.ImportPath}}: {{.Error}}{{end}}' .
+stdout 'example.com/missing: use.go:3:8: cannot find module providing package example.com/missing: import lookup disabled by -mod=readonly'
+
+-- go.mod --
+module example.com/m
+
+go 1.14
+
+-- use.go --
+package use
+
+import _ "example.com/missing"
diff --git a/libgo/go/cmd/go/testdata/script/mod_list_upgrade.txt b/libgo/go/cmd/go/testdata/script/mod_list_upgrade.txt
index f2d06490920..474df0dc269 100644
--- a/libgo/go/cmd/go/testdata/script/mod_list_upgrade.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_list_upgrade.txt
@@ -1,28 +1,8 @@
env GO111MODULE=on
-# If the current version is not latest, 'go list -u' should include its upgrade.
go list -m -u all
stdout 'rsc.io/quote v1.2.0 \[v1\.5\.2\]'
-# If the current version is latest, 'go list -u' should omit the upgrade.
-go get -d rsc.io/quote@v1.5.2
-go list -m -u all
-stdout 'rsc.io/quote v1.5.2$'
-
-# If the current version is newer than latest, 'go list -u' should
-# omit the upgrade.
-go get -d rsc.io/quote@v1.5.3-pre1
-go list -m -u all
-stdout 'rsc.io/quote v1.5.3-pre1$'
-
-# If the current build list has a higher version and the user asks about
-# a lower one, -u should report the upgrade for the lower one
-# but leave the build list unchanged.
-go list -m -u rsc.io/quote@v1.5.1
-stdout 'rsc.io/quote v1.5.1 \[v1.5.2\]$'
-go list -m -u rsc.io/quote
-stdout 'rsc.io/quote v1.5.3-pre1$'
-
-- go.mod --
module x
require rsc.io/quote v1.2.0
diff --git a/libgo/go/cmd/go/testdata/script/mod_load_badchain.txt b/libgo/go/cmd/go/testdata/script/mod_load_badchain.txt
index b97a2e6eaba..2c532f1fda3 100644
--- a/libgo/go/cmd/go/testdata/script/mod_load_badchain.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_load_badchain.txt
@@ -56,11 +56,13 @@ import (
func Test(t *testing.T) {}
-- update-main-expected --
+go: example.com/badchain/c upgrade => v1.1.0
go get: example.com/badchain/c@v1.0.0 updating to
example.com/badchain/c@v1.1.0: parsing go.mod:
module declares its path as: badchain.example.com/c
but was required as: example.com/badchain/c
-- update-a-expected --
+go: example.com/badchain/a upgrade => v1.1.0
go get: example.com/badchain/a@v1.1.0 requires
example.com/badchain/b@v1.1.0 requires
example.com/badchain/c@v1.1.0: parsing go.mod:
@@ -73,11 +75,13 @@ go: example.com/badchain/a@v1.1.0 requires
module declares its path as: badchain.example.com/c
but was required as: example.com/badchain/c
-- list-missing-expected --
+go: found example.com/badchain/c in example.com/badchain/c v1.1.0
go: m/use imports
example.com/badchain/c: example.com/badchain/c@v1.1.0: parsing go.mod:
module declares its path as: badchain.example.com/c
but was required as: example.com/badchain/c
-- list-missing-test-expected --
+go: found example.com/badchain/c in example.com/badchain/c v1.1.0
go: m/testuse tested by
m/testuse.test imports
example.com/badchain/c: example.com/badchain/c@v1.1.0: parsing go.mod:
diff --git a/libgo/go/cmd/go/testdata/script/mod_missing_repo.txt b/libgo/go/cmd/go/testdata/script/mod_missing_repo.txt
new file mode 100644
index 00000000000..8dae85fa88d
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_missing_repo.txt
@@ -0,0 +1,15 @@
+# Regression test for golang.org/issue/34094: modules hosted within gitlab.com
+# subgroups could not be fetched because the server returned bogus go-import
+# tags for prefixes of the module path.
+
+[!net] skip
+[!exec:git] skip
+
+env GO111MODULE=on
+env GOPROXY=direct
+env GOSUMDB=off
+
+! go get -d vcs-test.golang.org/go/missingrepo/missingrepo-git
+stderr 'vcs-test.golang.org/go/missingrepo/missingrepo-git: git ls-remote .*: exit status .*'
+
+go get -d vcs-test.golang.org/go/missingrepo/missingrepo-git/notmissing
diff --git a/libgo/go/cmd/go/testdata/script/mod_missingpkg_prerelease.txt b/libgo/go/cmd/go/testdata/script/mod_missingpkg_prerelease.txt
index 6203606c22d..319ff855872 100644
--- a/libgo/go/cmd/go/testdata/script/mod_missingpkg_prerelease.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_missingpkg_prerelease.txt
@@ -3,6 +3,11 @@ env GO111MODULE=on
! go list use.go
stderr 'example.com/missingpkg/deprecated: package provided by example.com/missingpkg at latest version v1.0.0 but not at required version v1.0.1-beta'
+-- go.mod --
+module m
+
+go 1.14
+
-- use.go --
package use
diff --git a/libgo/go/cmd/go/testdata/script/mod_modinfo.txt b/libgo/go/cmd/go/testdata/script/mod_modinfo.txt
index 1e7dd44a13d..731f53c6721 100644
--- a/libgo/go/cmd/go/testdata/script/mod_modinfo.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_modinfo.txt
@@ -3,7 +3,8 @@
# when module is enabled.
env GO111MODULE=on
-[gccgo] stop
+# gccgo doesn't support reading modinfo in init functions.
+[gccgo] skip
cd x
go mod edit -require=rsc.io/quote@v1.5.2
diff --git a/libgo/go/cmd/go/testdata/script/mod_outside.txt b/libgo/go/cmd/go/testdata/script/mod_outside.txt
index 4182e71dde1..03ef576168c 100644
--- a/libgo/go/cmd/go/testdata/script/mod_outside.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_outside.txt
@@ -17,7 +17,7 @@ go list -m
stdout '^command-line-arguments$'
# 'go list' in the working directory should fail even if there is a a 'package
# main' present: without a main module, we do not know its package path.
-! go list ./foo
+! go list ./needmod
stderr 'cannot find main module'
# 'go list all' lists the transitive import graph of the main module,
@@ -25,8 +25,6 @@ stderr 'cannot find main module'
go list all
! stdout .
stderr 'warning: "all" matched no packages'
-go list -m all
-stderr 'warning: pattern "all" matched no module dependencies'
# 'go list' on standard-library packages should work, since they do not depend
# on the contents of any module.
@@ -38,7 +36,7 @@ go list $GOROOT/src/fmt
stdout '^fmt$'
# 'go list' should work with file arguments.
-go list ./foo/foo.go
+go list ./needmod/needmod.go
stdout 'command-line-arguments'
# 'go list -m' with an explicit version should resolve that version.
@@ -49,12 +47,22 @@ stdout 'example.com/version v1.1.0'
go list -m -versions example.com/version
stdout 'v1.0.0\s+v1.0.1\s+v1.1.0'
-# 'go list -m <mods> all' does not include the dependencies of <mods> in the computation of 'all'.
-go list -m example.com/printversion@v1.0.0 all
-stdout 'example.com/printversion v1.0.0'
-stderr 'warning: pattern "all" matched no module dependencies'
+# 'go list -m all' should fail. "all" is not meaningful outside of a module.
+! go list -m all
+stderr 'go: cannot match "all": working directory is not part of a module'
+
+# 'go list -m <mods> all' should also fail.
+! go list -m example.com/printversion@v1.0.0 all
+stderr 'go: cannot match "all": working directory is not part of a module'
! stdout 'example.com/version'
+# 'go list -m' with wildcards should fail. Wildcards match modules in the
+# build list, so they aren't meaningful outside a module.
+! go list -m ...
+stderr 'go: cannot match "...": working directory is not part of a module'
+! go list -m rsc.io/quote/...
+stderr 'go: cannot match "rsc.io/quote/...": working directory is not part of a module'
+
# 'go clean' should skip the current directory if it isn't in a module.
go clean -n
@@ -66,10 +74,9 @@ go mod graph
! stdout .
! stderr .
-# 'go mod why' should report that nothing is a dependency.
-go mod why -m example.com/version
-stdout 'does not need'
-
+# 'go mod why' should fail, since there is no main module to depend on anything.
+! go mod why -m example.com/version
+stderr 'cannot find main module'
# 'go mod edit', 'go mod tidy', and 'go mod fmt' should fail:
# there is no go.mod file to edit.
@@ -81,21 +88,30 @@ stderr 'cannot find main module'
stderr 'cannot find main module'
+# 'go mod download' without arguments should report an error.
+! go mod download
+stderr 'no modules specified'
+
# 'go mod download' should download exactly the requested module without dependencies.
rm -r $GOPATH/pkg/mod/cache/download/example.com
go mod download example.com/printversion@v1.0.0
exists $GOPATH/pkg/mod/cache/download/example.com/printversion/@v/v1.0.0.zip
! exists $GOPATH/pkg/mod/cache/download/example.com/version/@v/v1.0.0.zip
+# 'go mod download all' should fail. "all" is not meaningful outside of a module.
+! go mod download all
+stderr 'go: cannot match "all": working directory is not part of a module'
+
+
# 'go mod vendor' should fail: it starts by clearing the existing vendor
# directory, and we don't know where that is.
! go mod vendor
stderr 'cannot find main module'
-# 'go mod verify' should succeed: we have no modules to verify.
-go mod verify
-stdout 'all modules verified'
-! stderr .
+
+# 'go mod verify' should fail: we have no modules to verify.
+! go mod verify
+stderr 'cannot find main module'
# 'go get' without arguments implicitly operates on the main module, and thus
@@ -104,14 +120,13 @@ stdout 'all modules verified'
stderr 'cannot find main module'
! go get -u
stderr 'cannot find main module'
-! go get -u ./foo
+! go get -u ./needmod
stderr 'cannot find main module'
# 'go get -u all' upgrades the transitive import graph of the main module,
# which is empty.
-go get -u all
-! stdout .
-stderr 'warning: "all" matched no packages'
+! go get -u all
+stderr 'go get all: cannot match "all": working directory is not part of a module'
# 'go get' should check the proposed module graph for consistency,
# even though we won't write it anywhere.
@@ -126,35 +141,75 @@ exists $GOPATH/pkg/mod/example.com/version@v1.0.0
# 'go build' without arguments implicitly operates on the current directory, and should fail.
-cd foo
+cd needmod
! go build
stderr 'cannot find main module'
cd ..
# 'go build' of a non-module directory should fail too.
-! go build ./foo
+! go build ./needmod
stderr 'cannot find main module'
-# However, 'go build' should succeed for standard-library packages.
+# 'go build' of source files should fail if they import anything outside std.
+! go build -n ./needmod/needmod.go
+stderr 'needmod[/\\]needmod.go:10:2: cannot find module providing package example.com/version: working directory is not part of a module'
+
+# 'go build' of source files should succeed if they do not import anything outside std.
+go build -n -o ignore ./stdonly/stdonly.go
+
+# 'go build' should succeed for standard-library packages.
go build -n fmt
-# TODO(golang.org/issue/28992): 'go doc' should document the latest version.
-# For now it does not.
+# 'go doc' without arguments implicitly operates on the current directory, and should fail.
+# TODO(golang.org/issue/32027): currently, it succeeds.
+cd needmod
+go doc
+cd ..
+
+# 'go doc' of a non-module directory should also succeed.
+go doc ./needmod
+
+# 'go doc' should succeed for standard-library packages.
+go doc fmt
+
+# 'go doc' should fail for a package path outside a module.
! go doc example.com/version
-stderr 'no such package'
+stderr 'doc: cannot find module providing package example.com/version: working directory is not part of a module'
# 'go install' with a version should fail due to syntax.
! go install example.com/printversion@v1.0.0
stderr 'can only use path@version syntax with'
+# 'go install' should fail if a package argument must be resolved to a module.
+! go install example.com/printversion
+stderr 'cannot find module providing package example.com/printversion: working directory is not part of a module'
+
+# 'go install' should fail if a source file imports a package that must be
+# resolved to a module.
+! go install ./needmod/needmod.go
+stderr 'needmod[/\\]needmod.go:10:2: cannot find module providing package example.com/version: working directory is not part of a module'
+
+
+# 'go run' with a verison should fail due to syntax.
+! go run example.com/printversion@v1.0.0
+stderr 'can only use path@version syntax with'
+
+# 'go run' should fail if a package argument must be resolved to a module.
+! go run example.com/printversion
+stderr 'cannot find module providing package example.com/printversion: working directory is not part of a module'
+
+# 'go run' should fail if a source file imports a package that must be
+# resolved to a module.
+! go run ./needmod/needmod.go
+stderr 'needmod[/\\]needmod.go:10:2: cannot find module providing package example.com/version: working directory is not part of a module'
+
# 'go fmt' should be able to format files outside of a module.
-go fmt foo/foo.go
+go fmt needmod/needmod.go
# The remainder of the test checks dependencies by linking and running binaries.
-[short] stop
# 'go get' of a binary without a go.mod should install the requested version,
# resolving outside dependencies to the latest available versions.
@@ -180,39 +235,31 @@ stdout 'path is example.com/printversion'
stdout 'main is example.com/printversion v1.0.0'
stdout 'using example.com/version v1.0.1'
-# 'go install' without a version should install the latest version
-# using its minimal module requirements.
-go install example.com/printversion
-exec ../bin/printversion
-stdout 'path is example.com/printversion'
-stdout 'main is example.com/printversion v1.0.0'
-stdout 'using example.com/version v1.0.0'
-
-# 'go run' should use 'main' as the effective module and import path.
-go run ./foo/foo.go
+# 'go run' should work with file arguments if they don't import anything
+# outside std.
+go run ./stdonly/stdonly.go
stdout 'path is command-line-arguments$'
stdout 'main is command-line-arguments \(devel\)'
-stdout 'using example.com/version v1.1.0'
# 'go generate' should work with file arguments.
-[exec:touch] go generate ./foo/foo.go
-[exec:touch] exists ./foo/gen.txt
+[exec:touch] go generate ./needmod/needmod.go
+[exec:touch] exists ./needmod/gen.txt
# 'go install' should work with file arguments.
-go install ./foo/foo.go
+go install ./stdonly/stdonly.go
# 'go test' should work with file arguments.
-go test -v ./foo/foo_test.go
-stdout 'foo was tested'
+go test -v ./stdonly/stdonly_test.go
+stdout 'stdonly was tested'
# 'go vet' should work with file arguments.
-go vet ./foo/foo.go
+go vet ./stdonly/stdonly.go
-- README.txt --
There is no go.mod file in the working directory.
--- foo/foo.go --
+-- needmod/needmod.go --
//go:generate touch gen.txt
package main
@@ -237,7 +284,28 @@ func main() {
}
}
--- foo/foo_test.go --
+-- stdonly/stdonly.go --
+package main
+
+import (
+ "fmt"
+ "os"
+ "runtime/debug"
+)
+
+func main() {
+ info, ok := debug.ReadBuildInfo()
+ if !ok {
+ panic("missing build info")
+ }
+ fmt.Fprintf(os.Stdout, "path is %s\n", info.Path)
+ fmt.Fprintf(os.Stdout, "main is %s %s\n", info.Main.Path, info.Main.Version)
+ for _, m := range info.Deps {
+ fmt.Fprintf(os.Stdout, "using %s %s\n", m.Path, m.Version)
+ }
+}
+
+-- stdonly/stdonly_test.go --
package main
import (
@@ -245,6 +313,7 @@ import (
"testing"
)
-func TestFoo(t *testing.T) {
- fmt.Println("foo was tested")
+func Test(t *testing.T) {
+ fmt.Println("stdonly was tested")
}
+
diff --git a/libgo/go/cmd/go/testdata/script/mod_permissions.txt b/libgo/go/cmd/go/testdata/script/mod_permissions.txt
new file mode 100644
index 00000000000..11fb4754f83
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_permissions.txt
@@ -0,0 +1,57 @@
+# Regression test for golang.org/issue/34634: permissions for the go.sum and
+# go.mod files should be preserved when overwriting them.
+
+env GO111MODULE=on
+[short] skip
+
+# Skip platforms that do not have Unix-style file permissions.
+[windows] skip
+[plan9] skip
+
+chmod 0640 go.mod
+chmod 0604 go.sum
+go mod edit -module=golang.org/issue/34634
+
+go build .
+cmp go.mod go.mod.want
+cmp go.sum go.sum.want
+
+go run .
+stdout 'go.mod: 0640'
+stdout 'go.sum: 0604'
+
+-- read_perm.go --
+package main
+
+import (
+ "fmt"
+ "os"
+ _ "rsc.io/sampler"
+)
+
+func main() {
+ for _, name := range []string{"go.mod", "go.sum"} {
+ fi, err := os.Stat(name)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "%s: %v\n", err)
+ continue
+ }
+ fmt.Printf("%s: 0%o\n", name, fi.Mode().Perm())
+ }
+}
+-- go.mod --
+module TODO
+
+go 1.14
+-- go.sum --
+-- go.mod.want --
+module golang.org/issue/34634
+
+go 1.14
+
+require rsc.io/sampler v1.99.99
+-- go.sum.want --
+golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c h1:pvCbr/wm8HzDD3fVywevekufpn6tCGPY3spdHeZJEsw=
+golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+rsc.io/sampler v1.99.99 h1:iMG9lbEG/8MdeR4lgL+Q8IcwbLNw7ijW7fTiK8Miqts=
+rsc.io/sampler v1.99.99/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
diff --git a/libgo/go/cmd/go/testdata/script/mod_prefer_compatible.txt b/libgo/go/cmd/go/testdata/script/mod_prefer_compatible.txt
new file mode 100644
index 00000000000..aa6260f63c8
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_prefer_compatible.txt
@@ -0,0 +1,65 @@
+# Regression test for golang.org/issue/34189 and golang.org/issue/34165:
+# @latest, @upgrade, and @patch should prefer compatible versions over
+# +incompatible ones, even if offered by a proxy.
+
+[!net] skip
+
+env GO111MODULE=on
+env GOPROXY=
+env GOSUMDB=
+
+# github.com/russross/blackfriday v2.0.0+incompatible exists,
+# and should be resolved if we ask for v2.0 explicitly.
+
+go list -m github.com/russross/blackfriday@v2.0
+stdout '^github.com/russross/blackfriday v2\.0\.0\+incompatible$'
+
+# blackfriday v1.5.2 has a go.mod file, so v1.5.2 should be preferred over
+# v2.0.0+incompatible when resolving latest, upgrade, and patch.
+
+go list -m github.com/russross/blackfriday@latest
+stdout '^github.com/russross/blackfriday v1\.'
+
+go list -m github.com/russross/blackfriday@upgrade
+stdout '^github.com/russross/blackfriday v1\.'
+
+go list -m github.com/russross/blackfriday@patch
+stdout '^github.com/russross/blackfriday v1\.'
+
+# If we're fetching directly from version control, ignored +incompatible
+# versions should also be omitted by 'go list'.
+
+# (Note that they may still be included in results from a proxy: in proxy mode,
+# we would need to fetch the whole zipfile for the latest compatible version in
+# order to determine whether it contains a go.mod file, and part of the point of
+# the proxy is to avoid fetching unnecessary data.)
+
+[!exec:git] stop
+env GOPROXY=direct
+
+go list -versions -m github.com/russross/blackfriday github.com/russross/blackfriday
+stdout '^github.com/russross/blackfriday v1\.5\.1 v1\.5\.2' # and possibly others
+! stdout ' v2\.'
+
+# However, if the latest compatible version does not include a go.mod file,
+# +incompatible versions should still be listed, as they may still reflect the
+# intent of the module author.
+
+go list -versions -m github.com/rsc/legacytest
+stdout '^github.com/rsc/legacytest v1\.0\.0 v1\.1\.0-pre v1\.2\.0 v2\.0\.0\+incompatible'
+
+# If we're fetching directly from version control, asking for a commit hash
+# corresponding to a +incompatible version should continue to produce the
+# +incompatible version tagged for that commit, even if it is no longer listed.
+
+go list -m github.com/russross/blackfriday@cadec560ec52
+stdout '^github.com/russross/blackfriday v2\.0\.0\+incompatible$'
+
+# Similarly, requesting an untagged commit should continue to produce a +incompatible
+# pseudo-version.
+
+go list -m github.com/rsc/legacytest@7303f7796364
+stdout '^github.com/rsc/legacytest v2\.0\.1-0\.20180717164253-7303f7796364\+incompatible$'
+
+-- go.mod --
+module github.com/golang.org/issue/34165
diff --git a/libgo/go/cmd/go/testdata/script/mod_proxy_errors.txt b/libgo/go/cmd/go/testdata/script/mod_proxy_errors.txt
new file mode 100644
index 00000000000..9cd1a824f08
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_proxy_errors.txt
@@ -0,0 +1,19 @@
+[!net] skip
+
+env GO111MODULE=on
+env GOSUMDB=off
+env GOPROXY=direct
+
+# Server responses should be truncated to some reasonable number of lines.
+# (For now, exactly eight.)
+! go list -m vcs-test.golang.org/auth/ormanylines@latest
+stderr '\tserver response:\n(.|\n)*\tline 8\n\t\[Truncated: too many lines.\]$'
+
+# Server responses should be truncated to some reasonable number of characters.
+! go list -m vcs-test.golang.org/auth/oronelongline@latest
+! stderr 'blah{40}'
+stderr '\tserver response: \[Truncated: too long\.\]$'
+
+# Responses from servers using the 'mod' protocol should be propagated.
+! go list -m vcs-test.golang.org/go/modauth404@latest
+stderr '\tserver response: File\? What file\?'
diff --git a/libgo/go/cmd/go/testdata/script/mod_readonly.txt b/libgo/go/cmd/go/testdata/script/mod_readonly.txt
index ff25f4bfe2f..1d1771e9cc0 100644
--- a/libgo/go/cmd/go/testdata/script/mod_readonly.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_readonly.txt
@@ -2,16 +2,22 @@ env GO111MODULE=on
[short] skip
# -mod=readonly must not resolve missing modules nor update go.mod
-#
-# TODO(bcmills): 'go list' should suffice, but today it does not fail due to
-# unresolved imports. When that is fixed, use 'go list' instead of 'go list all'.
env GOFLAGS=-mod=readonly
go mod edit -fmt
cp go.mod go.mod.empty
! go list all
-stderr 'import lookup disabled by -mod=readonly'
+stderr '^can''t load package: x.go:2:8: cannot find module providing package rsc\.io/quote: import lookup disabled by -mod=readonly'
cmp go.mod go.mod.empty
+# -mod=readonly should be set implicitly if the go.mod file is read-only
+chmod 0400 go.mod
+env GOFLAGS=
+! go list all
+stderr '^can''t load package: x.go:2:8: cannot find module providing package rsc\.io/quote: import lookup disabled by -mod=readonly\n\t\(go.mod file is read-only\.\)$'
+
+chmod 0600 go.mod
+env GOFLAGS=-mod=readonly
+
# update go.mod - go get allowed
go get rsc.io/quote
grep rsc.io/quote go.mod
@@ -19,13 +25,14 @@ grep rsc.io/quote go.mod
# update go.mod - go mod tidy allowed
cp go.mod.empty go.mod
go mod tidy
+cp go.mod go.mod.tidy
# -mod=readonly must succeed once go.mod is up-to-date...
-go list
+go list all
# ... even if it needs downloads
go clean -modcache
-go list
+go list all
# -mod=readonly should reject inconsistent go.mod files
# (ones that would be rewritten).
@@ -35,6 +42,19 @@ cp go.mod go.mod.inconsistent
stderr 'go: updates to go.mod needed, disabled by -mod=readonly'
cmp go.mod go.mod.inconsistent
+# However, it should not reject files missing a 'go' directive,
+# since that was not always required.
+cp go.mod.nogo go.mod
+go list all
+
+# Nor should it reject files with redundant (not incorrect)
+# requirements.
+cp go.mod.redundant go.mod
+go list all
+
+cp go.mod.indirect go.mod
+go list all
+
-- go.mod --
module m
@@ -43,3 +63,30 @@ go 1.20
-- x.go --
package x
import _ "rsc.io/quote"
+-- go.mod.nogo --
+module m
+
+require (
+ rsc.io/quote v1.5.2
+ rsc.io/testonly v1.0.0 // indirect
+)
+-- go.mod.redundant --
+module m
+
+go 1.20
+
+require (
+ rsc.io/quote v1.5.2
+ rsc.io/sampler v1.3.0 // indirect
+ rsc.io/testonly v1.0.0 // indirect
+)
+-- go.mod.indirect --
+module m
+
+go 1.20
+
+require (
+ rsc.io/quote v1.5.2 // indirect
+ rsc.io/sampler v1.3.0 // indirect
+ rsc.io/testonly v1.0.0 // indirect
+)
diff --git a/libgo/go/cmd/go/testdata/script/mod_replace.txt b/libgo/go/cmd/go/testdata/script/mod_replace.txt
index 35824b3a8a2..c21f1720021 100644
--- a/libgo/go/cmd/go/testdata/script/mod_replace.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_replace.txt
@@ -38,6 +38,20 @@ grep 'not-rsc.io/quote/v3 v3.1.0' go.mod
exec ./a5.exe
stdout 'Concurrency is not parallelism.'
+# Error messages for modules not found in replacements should
+# indicate the replacement module.
+cp go.mod.orig go.mod
+go mod edit -replace=rsc.io/quote/v3=./local/rsc.io/quote/v3
+! go get -d rsc.io/quote/v3/missing-package
+stderr 'module rsc.io/quote/v3@upgrade found \(v3.0.0, replaced by ./local/rsc.io/quote/v3\), but does not contain package'
+
+# The reported Dir and GoMod for a replaced module should be accurate.
+cp go.mod.orig go.mod
+go mod edit -replace=rsc.io/quote/v3=not-rsc.io/quote@v0.1.0-nomod
+go mod download
+go list -m -f '{{.Path}} {{.Version}} {{.Dir}} {{.GoMod}}{{with .Replace}} => {{.Path}} {{.Version}} {{.Dir}} {{.GoMod}}{{end}}' rsc.io/quote/v3
+stdout '^rsc.io/quote/v3 v3.0.0 '$GOPATH'[/\\]pkg[/\\]mod[/\\]not-rsc.io[/\\]quote@v0.1.0-nomod '$GOPATH'[/\\]pkg[/\\]mod[/\\]cache[/\\]download[/\\]not-rsc.io[/\\]quote[/\\]@v[/\\]v0.1.0-nomod.mod => not-rsc.io/quote v0.1.0-nomod '$GOPATH'[/\\]pkg[/\\]mod[/\\]not-rsc.io[/\\]quote@v0.1.0-nomod '$GOPATH'[/\\]pkg[/\\]mod[/\\]cache[/\\]download[/\\]not-rsc.io[/\\]quote[/\\]@v[/\\]v0.1.0-nomod.mod$'
+
-- go.mod --
module quoter
diff --git a/libgo/go/cmd/go/testdata/script/mod_replace_gopkgin.txt b/libgo/go/cmd/go/testdata/script/mod_replace_gopkgin.txt
new file mode 100644
index 00000000000..6608fb1b801
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_replace_gopkgin.txt
@@ -0,0 +1,28 @@
+# Regression test for golang.org/issue/34254:
+# a clone of gopkg.in/[…].vN should be replaceable by
+# a fork hosted at corp.example.com/[…]/vN,
+# even if there is an explicit go.mod file containing the
+# gopkg.in path.
+
+[short] skip
+[!net] skip
+[!exec:git] skip
+
+env GO111MODULE=on
+env GOPROXY=direct
+env GOSUMDB=off
+
+# Replacing gopkg.in/[…].vN with a repository with a root go.mod file
+# specifying […].vN and a compatible version should succeed, even if
+# the replacement path is not a gopkg.in path.
+cd dot-to-dot
+go list gopkg.in/src-d/go-git.v4
+
+-- dot-to-dot/go.mod --
+module golang.org/issue/34254
+
+go 1.13
+
+require gopkg.in/src-d/go-git.v4 v4.13.1
+
+replace gopkg.in/src-d/go-git.v4 v4.13.1 => github.com/src-d/go-git/v4 v4.13.1
diff --git a/libgo/go/cmd/go/testdata/script/mod_replace_import.txt b/libgo/go/cmd/go/testdata/script/mod_replace_import.txt
index 0da753a1a76..941ef61d355 100644
--- a/libgo/go/cmd/go/testdata/script/mod_replace_import.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_replace_import.txt
@@ -23,6 +23,13 @@ stdout 'example.com/y v0.0.0-00010101000000-000000000000 => ./y'
stdout 'example.com/x/v3 v3.0.0-00010101000000-000000000000 => ./v3'
stdout 'example.com/v v1.12.0 => ./v12'
+# The go command should print an informative error when the matched
+# module does not contain a package.
+cd fail
+! go list all
+stdout 'localhost.fail'
+stderr '^can.t load package: m.go:3:8: module w@latest found \(v0.0.0-00010101000000-000000000000, replaced by ../w\), but does not contain package w$'
+
-- go.mod --
module example.com/m
@@ -107,3 +114,16 @@ package v
module v.localhost
-- v/v.go --
package v
+
+-- fail/m.go --
+package main
+
+import _ "w"
+
+func main() {}
+
+-- fail/go.mod --
+module localhost.fail
+
+replace w => ../w
+
diff --git a/libgo/go/cmd/go/testdata/script/mod_retention.txt b/libgo/go/cmd/go/testdata/script/mod_retention.txt
new file mode 100644
index 00000000000..bff4142ad83
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_retention.txt
@@ -0,0 +1,135 @@
+# Regression test for golang.org/issue/34822: the 'go' command should prefer not
+# to update the go.mod file if the changes only affect formatting, and should only
+# remove redundant requirements in 'go mod tidy'.
+
+env GO111MODULE=on
+[short] skip
+
+# Control case: verify that go.mod.tidy is actually tidy.
+cp go.mod.tidy go.mod
+go list all
+cmp go.mod go.mod.tidy
+
+
+# If the only difference in the go.mod file is the line endings,
+# it should not be overwritten automatically.
+cp go.mod.crlf go.mod
+go list all
+cmp go.mod go.mod.crlf
+
+# However, 'go mod tidy' should fix whitespace even if there are no other changes.
+go mod tidy
+cmp go.mod go.mod.tidy
+
+
+# Out-of-order requirements should not be overwritten automatically...
+cp go.mod.unsorted go.mod
+go list all
+cmp go.mod go.mod.unsorted
+
+# ...but 'go mod edit -fmt' should sort them.
+go mod edit -fmt
+cmp go.mod go.mod.tidy
+
+
+# "// indirect" comments should be removed if direct dependencies are seen.
+# changes.
+cp go.mod.indirect go.mod
+go list all
+cmp go.mod go.mod.tidy
+
+# "// indirect" comments should be added if appropriate.
+cp go.mod.toodirect go.mod
+go list all
+cmp go.mod go.mod.toodirect
+go mod vendor # loads everything, so adds "// indirect" comments.
+cmp go.mod go.mod.tidy
+rm -r vendor
+
+
+# Redundant requirements should be preserved...
+cp go.mod.redundant go.mod
+go list all
+cmp go.mod go.mod.redundant
+go mod vendor
+cmp go.mod go.mod.redundant
+rm -r vendor
+
+# ...except by 'go mod tidy'.
+go mod tidy
+cmp go.mod go.mod.tidy
+
+
+# A missing "go" version directive should be added.
+# However, that should not remove other redundant requirements.
+cp go.mod.nogo go.mod
+go list all
+cmp go.mod go.mod.redundant
+
+
+-- go.mod.tidy --
+module m
+
+go 1.14
+
+require (
+ rsc.io/quote v1.5.2
+ rsc.io/testonly v1.0.0 // indirect
+)
+-- x.go --
+package x
+import _ "rsc.io/quote"
+-- go.mod.crlf --
+module m
+
+go 1.14
+
+require (
+ rsc.io/quote v1.5.2
+ rsc.io/testonly v1.0.0 // indirect
+)
+-- go.mod.unsorted --
+module m
+
+go 1.14
+
+require (
+ rsc.io/testonly v1.0.0 // indirect
+ rsc.io/quote v1.5.2
+)
+-- go.mod.indirect --
+module m
+
+go 1.14
+
+require (
+ rsc.io/quote v1.5.2 // indirect
+ rsc.io/testonly v1.0.0 // indirect
+)
+-- go.mod.toodirect --
+module m
+
+go 1.14
+
+require (
+ rsc.io/quote v1.5.2
+ rsc.io/testonly v1.0.0
+)
+-- go.mod.redundant --
+module m
+
+go 1.14
+
+require (
+ rsc.io/quote v1.5.2
+ rsc.io/sampler v1.3.0 // indirect
+ rsc.io/testonly v1.0.0 // indirect
+)
+-- go.mod.nogo --
+module m
+
+require (
+ rsc.io/quote v1.5.2
+ rsc.io/sampler v1.3.0 // indirect
+ rsc.io/testonly v1.0.0 // indirect
+)
diff --git a/libgo/go/cmd/go/testdata/script/mod_sumdb.txt b/libgo/go/cmd/go/testdata/script/mod_sumdb.txt
index 641b9e73bcc..caf97e9699f 100644
--- a/libgo/go/cmd/go/testdata/script/mod_sumdb.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_sumdb.txt
@@ -9,7 +9,7 @@ env dbname=localhost.localdev/sumdb
cp go.mod.orig go.mod
env GOSUMDB=$sumdb' '$proxy/sumdb-wrong
! go get -d rsc.io/quote
-stderr 'verifying rsc.io/quote@v1.5.2: checksum mismatch'
+stderr 'go get rsc.io/quote: rsc.io/quote@v1.5.2: verifying module: checksum mismatch'
stderr 'downloaded: h1:3fEy'
stderr 'localhost.localdev/sumdb: h1:wrong'
stderr 'SECURITY ERROR\nThis download does NOT match the one reported by the checksum server.'
diff --git a/libgo/go/cmd/go/testdata/script/mod_sumdb_cache.txt b/libgo/go/cmd/go/testdata/script/mod_sumdb_cache.txt
index 486bdf5ecf6..2937b2e4dcd 100644
--- a/libgo/go/cmd/go/testdata/script/mod_sumdb_cache.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_sumdb_cache.txt
@@ -37,7 +37,14 @@ env GOPROXY=$proxy/sumdb-504
! go get -d rsc.io/quote@v1.5.2
stderr 504
+# GOINSECURE does not bypass checksum lookup
+env GOINSECURE=rsc.io
+env GOPROXY=$proxy/sumdb-504
+! go get -d rsc.io/quote@v1.5.2
+stderr 504
+
# but -insecure bypasses the checksum lookup entirely
+env GOINSECURE=
go get -d -insecure rsc.io/quote@v1.5.2
# and then it is in go.sum again
diff --git a/libgo/go/cmd/go/testdata/script/mod_sumdb_file_path.txt b/libgo/go/cmd/go/testdata/script/mod_sumdb_file_path.txt
index 47c8a3a0f3c..6108c0a5d36 100644
--- a/libgo/go/cmd/go/testdata/script/mod_sumdb_file_path.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_sumdb_file_path.txt
@@ -7,10 +7,13 @@ env GOPATH=$WORK/gopath1
# With a file-based proxy with an empty checksum directory,
# downloading a new module should fail, even if a subsequent
# proxy contains a more complete mirror of the sum database.
+#
+# TODO(bcmills): The error message here is a bit redundant.
+# It comes from the sumweb package, which isn't yet producing structured errors.
[windows] env GOPROXY=file:///$WORK/sumproxy,https://proxy.golang.org
[!windows] env GOPROXY=file://$WORK/sumproxy,https://proxy.golang.org
! go get -d golang.org/x/text@v0.3.2
-stderr '^verifying golang.org/x/text.*: Not Found'
+stderr '^go get golang.org/x/text@v0.3.2: golang.org/x/text@v0.3.2: verifying module: golang.org/x/text@v0.3.2: reading file://.*/sumdb/sum.golang.org/lookup/golang.org/x/text@v0.3.2: (no such file or directory|.*cannot find the path specified.*)'
# If the proxy does not claim to support the database,
# checksum verification should fall through to the next proxy,
diff --git a/libgo/go/cmd/go/testdata/script/mod_test_files.txt b/libgo/go/cmd/go/testdata/script/mod_test_files.txt
index 87aecb44f67..6f520c7720d 100644
--- a/libgo/go/cmd/go/testdata/script/mod_test_files.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_test_files.txt
@@ -20,6 +20,7 @@ stderr 'use of internal package'
-- foo/go.mod --
module example.com/foo
+go 1.12
require example.com/internal v0.0.0
replace example.com/internal => ../internal
diff --git a/libgo/go/cmd/go/testdata/script/mod_tidy.txt b/libgo/go/cmd/go/testdata/script/mod_tidy.txt
index de3b52e2c02..b1d9371217c 100644
--- a/libgo/go/cmd/go/testdata/script/mod_tidy.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_tidy.txt
@@ -5,7 +5,6 @@ go mod tidy -v
stderr '^unused y.1'
! stderr '^unused [^y]'
-# tidy should not touch existing go line
grep 'go 1.10' go.mod
go list -m all
diff --git a/libgo/go/cmd/go/testdata/script/mod_tidy_cycle.txt b/libgo/go/cmd/go/testdata/script/mod_tidy_cycle.txt
new file mode 100644
index 00000000000..e46f37d7fa2
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_tidy_cycle.txt
@@ -0,0 +1,75 @@
+# Regression test for https://golang.org/issue/34086:
+# 'go mod tidy' produced different go.mod file from other
+# subcommands when certain kinds of cycles were present
+# in the build graph.
+
+env GO111MODULE=on
+
+cp go.mod go.mod.orig
+go mod tidy
+cmp go.mod go.mod.orig
+
+# If the go.mod file is already tidy, 'go mod graph' should not modify it.
+go mod graph
+cmp go.mod go.mod.orig
+
+-- go.mod --
+module root
+
+go 1.13
+
+replace (
+ a v0.1.0 => ./a1
+ b v0.1.0 => ./b1
+ b v0.2.0 => ./b2
+ c v0.1.0 => ./c1
+ c v0.2.0 => ./c2
+)
+
+require (
+ a v0.1.0
+ b v0.2.0 // indirect
+)
+-- main.go --
+package main
+
+import _ "a"
+
+func main() {}
+
+-- a1/go.mod --
+module a
+
+go 1.13
+
+require b v0.1.0
+-- a1/a.go --
+package a
+
+import _ "c"
+-- b1/go.mod --
+module b
+
+go 1.13
+
+require c v0.1.0
+-- b2/go.mod --
+module b
+
+go 1.13
+
+require c v0.2.0
+-- c1/go.mod --
+module c
+
+go 1.13
+-- c2/c.go --
+package c
+-- c2/go.mod --
+module c
+
+go 1.13
+
+require b v0.2.0
+-- c2/c.go --
+package c
diff --git a/libgo/go/cmd/go/testdata/script/mod_tidy_error.txt b/libgo/go/cmd/go/testdata/script/mod_tidy_error.txt
index 9bb8528cb0b..b6c24ceaf75 100644
--- a/libgo/go/cmd/go/testdata/script/mod_tidy_error.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_tidy_error.txt
@@ -4,12 +4,12 @@ env GO111MODULE=on
# 'go mod tidy' and 'go mod vendor' should not hide loading errors.
! go mod tidy
-stderr '^issue27063 imports\n\tnonexist: malformed module path "nonexist": missing dot in first path element'
+stderr '^issue27063 imports\n\tnonexist: package nonexist is not in GOROOT \(.*\)'
stderr '^issue27063 imports\n\tnonexist.example.com: cannot find module providing package nonexist.example.com'
stderr '^issue27063 imports\n\tissue27063/other imports\n\tother.example.com/nonexist: cannot find module providing package other.example.com/nonexist'
! go mod vendor
-stderr '^issue27063 imports\n\tnonexist: malformed module path "nonexist": missing dot in first path element'
+stderr '^issue27063 imports\n\tnonexist: package nonexist is not in GOROOT \(.*\)'
stderr '^issue27063 imports\n\tnonexist.example.com: cannot find module providing package nonexist.example.com'
stderr '^issue27063 imports\n\tissue27063/other imports\n\tother.example.com/nonexist: cannot find module providing package other.example.com/nonexist'
diff --git a/libgo/go/cmd/go/testdata/script/mod_tidy_replace.txt b/libgo/go/cmd/go/testdata/script/mod_tidy_replace.txt
index d5c22530944..c3158f8610e 100644
--- a/libgo/go/cmd/go/testdata/script/mod_tidy_replace.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_tidy_replace.txt
@@ -47,6 +47,12 @@ grep 'rsc.io/sampler v1.2.0' go.mod
cd outside
go list -m all
stdout 'rsc.io/sampler v1.3.0'
+cd ..
+
+# The same module can't be used as two different paths.
+cd multiple-paths
+! go mod tidy
+stderr 'rsc.io/quote/v3@v3.0.0 used for two different module paths \(not-rsc.io/quote/v3 and rsc.io/quote/v3\)'
-- go.mod --
module example.com/tidy
@@ -109,3 +115,23 @@ package b
module golang.org/issue/30166/b
require golang.org/issue/30166/a v0.0.0
+-- multiple-paths/main.go --
+package main
+
+import (
+ "fmt"
+ "rsc.io/quote/v3"
+)
+
+func main() {
+ fmt.Println(quote.GoV3())
+}
+-- multiple-paths/go.mod --
+module quoter
+
+require (
+ rsc.io/quote/v3 v3.0.0
+ not-rsc.io/quote/v3 v3.0.0
+)
+
+replace not-rsc.io/quote/v3 => rsc.io/quote/v3 v3.0.0
diff --git a/libgo/go/cmd/go/testdata/script/mod_vendor.txt b/libgo/go/cmd/go/testdata/script/mod_vendor.txt
index 5d872c3c80e..bb3e634b3a3 100644
--- a/libgo/go/cmd/go/testdata/script/mod_vendor.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_vendor.txt
@@ -1,15 +1,15 @@
env GO111MODULE=on
-go list -m all
-stdout '^x v1.0.0 => ./x'
-stdout '^w'
-
+# Without vendoring, a build should succeed unless -mod=vendor is set.
[!short] go build
[!short] ! go build -mod=vendor
+# Without vendoring, 'go list' should report the replacement directory for
+# a package in a replaced module.
go list -f {{.Dir}} x
stdout 'src[\\/]x'
+# 'go mod vendor' should copy all replaced modules to the vendor directory.
go mod vendor -v
stderr '^# x v1.0.0 => ./x'
stderr '^x'
@@ -20,28 +20,47 @@ stderr '^z'
! stderr '^w'
grep 'a/foo/bar/b\na/foo/bar/c' vendor/modules.txt # must be sorted
-go list -f {{.Dir}} x
+# An explicit '-mod=mod' should ignore the vendor directory.
+go list -mod=mod -f {{.Dir}} x
stdout 'src[\\/]x'
-go list -f {{.Dir}} -m x
+go list -mod=mod -f {{.Dir}} -m x
stdout 'src[\\/]x'
+# An explicit '-mod=vendor' should report package directories within
+# the vendor directory.
go list -mod=vendor -f {{.Dir}} x
stdout 'src[\\/]vendor[\\/]x'
-go list -mod=vendor -f {{.Dir}} -m x
-stdout 'src[\\/]vendor[\\/]x'
-
-go list -f {{.Dir}} -m w
+# 'go list -mod=vendor -m' should successfully list vendored modules,
+# but should not provide a module directory because no directory contains
+# the complete module.
+go list -mod=vendor -f '{{.Version}} {{.Dir}}' -m x
+stdout '^v1.0.0 $'
+
+# 'go list -mod=vendor -m' on a transitive dependency that does not
+# provide vendored packages should give a helpful error rather than
+# 'not a known dependency'.
+! go list -mod=vendor -f '{{.Version}} {{.Dir}}' -m diamondright
+stderr 'go list -m: module diamondright: can''t resolve module using the vendor directory\n\t\(Use -mod=mod or -mod=readonly to bypass.\)'
+
+# 'go list -mod=mod' should report packages outside the import graph,
+# but 'go list -mod=vendor' should error out for them.
+go list -mod=mod -f {{.Dir}} w
stdout 'src[\\/]w'
-
! go list -mod=vendor -f {{.Dir}} w
stderr 'src[\\/]vendor[\\/]w'
+go list -mod=mod -f {{.Dir}} diamondright
+stdout 'src[\\/]diamondright'
+
+# Test dependencies should not be copied.
! exists vendor/x/testdata
! exists vendor/a/foo/bar/b/ignored.go
! exists vendor/a/foo/bar/b/main_test.go
+# Licenses and other metadata for each module should be copied
+# if any package within their module is copied.
exists vendor/a/foo/AUTHORS.txt
exists vendor/a/foo/CONTRIBUTORS
exists vendor/a/foo/LICENSE
@@ -59,14 +78,18 @@ exists vendor/mysite/myname/mypkg/LICENSE.txt
[short] stop
-go build
+# 'go build' and 'go test' using vendored packages should succeed.
+go build -mod=mod
go build -mod=vendor
go test -mod=vendor . ./subdir
go test -mod=vendor ./...
+go fmt -mod=vendor ./...
-- go.mod --
module m
+go 1.13
+
require (
a v1.0.0
diamondroot v0.0.0
@@ -252,10 +275,11 @@ require (
-- diamondroot/x.go --
package diamondroot
-import (
- _ "diamondleft"
- _ "diamondright"
-)
+import _ "diamondleft"
+-- diamondroot/unused/unused.go --
+package unused
+
+import _ "diamondright"
-- diamondleft/go.mod --
module diamondleft
diff --git a/libgo/go/cmd/go/testdata/script/mod_vendor_auto.txt b/libgo/go/cmd/go/testdata/script/mod_vendor_auto.txt
new file mode 100644
index 00000000000..53120dcfa1f
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_vendor_auto.txt
@@ -0,0 +1,256 @@
+# Integration test for golang.org/issue/33848: automatically check and use vendored packages.
+
+env GO111MODULE=on
+
+[short] skip
+
+cd $WORK/auto
+cp go.mod go.mod.orig
+cp $WORK/modules-1.13.txt $WORK/auto/modules.txt
+
+# An explicit -mod=vendor should force use of the vendor directory.
+env GOFLAGS=-mod=vendor
+
+go list -f {{.Dir}} -tags tools all
+stdout '^'$WORK'[/\\]auto$'
+stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]printversion$'
+stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
+
+! go list -m all
+stderr 'go list -m: can''t compute ''all'' using the vendor directory\n\t\(Use -mod=mod or -mod=readonly to bypass.\)'
+
+! go list -m -f '{{.Dir}}' all
+stderr 'go list -m: can''t compute ''all'' using the vendor directory\n\t\(Use -mod=mod or -mod=readonly to bypass.\)'
+
+# An explicit -mod=mod should force the vendor directory to be ignored.
+env GOFLAGS=-mod=mod
+
+go list -f {{.Dir}} -tags tools all
+stdout '^'$WORK'[/\\]auto$'
+stdout '^'$GOPATH'[/\\]pkg[/\\]mod[/\\]example.com[/\\]printversion@v1.0.0$'
+stdout '^'$WORK'[/\\]auto[/\\]replacement-version$'
+
+go list -m all
+stdout '^example.com/auto$'
+stdout 'example.com/printversion v1.0.0'
+stdout 'example.com/version v1.0.0'
+
+go list -m -f '{{.Dir}}' all
+stdout '^'$WORK'[/\\]auto$'
+stdout '^'$GOPATH'[/\\]pkg[/\\]mod[/\\]example.com[/\\]printversion@v1.0.0$'
+stdout '^'$WORK'[/\\]auto[/\\]replacement-version$'
+
+# If the main module's "go" directive says 1.13, we should default to -mod=mod.
+env GOFLAGS=
+go mod edit -go=1.13
+
+go list -f {{.Dir}} -tags tools all
+stdout '^'$WORK'[/\\]auto$'
+stdout '^'$GOPATH'[/\\]pkg[/\\]mod[/\\]example.com[/\\]printversion@v1.0.0$'
+stdout '^'$WORK'[/\\]auto[/\\]replacement-version$'
+
+go list -m -f '{{.Dir}}' all
+stdout '^'$WORK'[/\\]auto$'
+stdout '^'$GOPATH'[/\\]pkg[/\\]mod[/\\]example.com[/\\]printversion@v1.0.0$'
+stdout '^'$WORK'[/\\]auto[/\\]replacement-version$'
+
+# A 'go 1.14' directive in the main module's go.mod file should enable
+# -mod=vendor by default, along with stronger checks for consistency
+# between the go.mod file and vendor/modules.txt.
+# A 'go 1.13' vendor/modules.txt file is not usually sufficient
+# to pass those checks.
+go mod edit -go=1.14
+
+! go list -f {{.Dir}} -tags tools all
+stderr '^go: inconsistent vendoring in '$WORK[/\\]auto':$'
+stderr '^\texample.com/printversion@v1.0.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt'
+stderr '^\texample.com/unused: is replaced in go.mod, but not marked as replaced in vendor/modules.txt'
+stderr '^\texample.com/version@v1.2.0: is replaced in go.mod, but not marked as replaced in vendor/modules.txt'
+stderr '\n\nrun .go mod vendor. to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory$'
+
+# Module-specific subcommands should continue to load the full module graph.
+go mod graph
+stdout '^example.com/printversion@v1.0.0 example.com/version@v1.0.0$'
+
+# An explicit -mod=mod should still force the vendor directory to be ignored.
+env GOFLAGS=-mod=mod
+
+go list -f {{.Dir}} -tags tools all
+stdout '^'$WORK'[/\\]auto$'
+stdout '^'$GOPATH'[/\\]pkg[/\\]mod[/\\]example.com[/\\]printversion@v1.0.0$'
+stdout '^'$WORK'[/\\]auto[/\\]replacement-version$'
+
+go list -m all
+stdout '^example.com/auto$'
+stdout 'example.com/printversion v1.0.0'
+stdout 'example.com/version v1.0.0'
+
+go list -m -f '{{.Dir}}' all
+stdout '^'$WORK'[/\\]auto$'
+stdout '^'$GOPATH'[/\\]pkg[/\\]mod[/\\]example.com[/\\]printversion@v1.0.0$'
+stdout '^'$WORK'[/\\]auto[/\\]replacement-version$'
+
+# 'go mod vendor' should repair vendor/modules.txt so that the implicit
+# -mod=vendor works again.
+env GOFLAGS=
+
+go mod edit -go=1.14
+go mod vendor
+
+go list -f {{.Dir}} -tags tools all
+stdout '^'$WORK'[/\\]auto$'
+stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]printversion$'
+stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
+
+# ...but 'go list -m' should continue to fail, this time without
+# referring to a -mod default that the user didn't set.
+! go list -m all
+stderr 'go list -m: can''t compute ''all'' using the vendor directory\n\t\(Use -mod=mod or -mod=readonly to bypass.\)'
+
+! go list -m -f '{{.Dir}}' all
+stderr 'go list -m: can''t compute ''all'' using the vendor directory\n\t\(Use -mod=mod or -mod=readonly to bypass.\)'
+
+
+# 'go mod init' should work if there is already a GOPATH-mode vendor directory
+# present. If there are no module dependencies, -mod=vendor should be used by
+# default and should not fail the consistency check even though no module
+# information is present.
+
+rm go.mod
+rm vendor/modules.txt
+
+go mod init example.com/auto
+go list -f {{.Dir}} -tags tools all
+stdout '^'$WORK'[/\\]auto$'
+stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]printversion$'
+stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
+
+# If information about dependencies is added to a 1.14 go.mod file, subsequent
+# list commands should error out if vendor/modules.txt is missing or incomplete.
+
+cp go.mod.orig go.mod
+go mod edit -go=1.14
+! go list -f {{.Dir}} -tags tools all
+stderr '^go: inconsistent vendoring in '$WORK[/\\]auto':$'
+stderr '^\texample.com/printversion@v1.0.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt'
+stderr '^\texample.com/unused: is replaced in go.mod, but not marked as replaced in vendor/modules.txt'
+stderr '^\texample.com/version@v1.2.0: is replaced in go.mod, but not marked as replaced in vendor/modules.txt'
+stderr '\n\nrun .go mod vendor. to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory$'
+
+# If -mod=vendor is set, limited consistency checks should apply even when
+# the go version is 1.13 or earlier.
+# An incomplete or missing vendor/modules.txt should resolve the vendored packages...
+go mod edit -go=1.13
+go list -mod=vendor -f {{.Dir}} -tags tools all
+stdout '^'$WORK'[/\\]auto$'
+stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]printversion$'
+stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
+
+# ...but a version mismatch for an explicit dependency should be noticed.
+cp $WORK/modules-bad-1.13.txt vendor/modules.txt
+! go list -mod=vendor -f {{.Dir}} -tags tools all
+stderr '^go: inconsistent vendoring in '$WORK[/\\]auto':$'
+stderr '^\texample.com/printversion@v1.0.0: is explicitly required in go.mod, but vendor/modules.txt indicates example.com/printversion@v1.1.0$'
+stderr '\n\nrun .go mod vendor. to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory$'
+
+# If the go version is still 1.13, 'go mod vendor' should write a
+# matching vendor/modules.txt containing the corrected 1.13 data.
+go mod vendor
+cmp $WORK/modules-1.13.txt vendor/modules.txt
+
+go list -mod=vendor -f {{.Dir}} -tags tools all
+stdout '^'$WORK'[/\\]auto$'
+stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]printversion$'
+stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
+
+# When the version is upgraded to 1.14, 'go mod vendor' should write a
+# vendor/modules.txt with the updated 1.14 annotations.
+go mod edit -go=1.14
+go mod vendor
+cmp $WORK/modules-1.14.txt vendor/modules.txt
+
+# Then, -mod=vendor should kick in automatically and succeed.
+go list -f {{.Dir}} -tags tools all
+stdout '^'$WORK'[/\\]auto$'
+stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]printversion$'
+stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
+
+# 'go get' should update from the network or module cache,
+# even if a vendor directory is present.
+go get -u example.com/printversion
+! go list -f {{.Dir}} -tags tools all
+stderr '^go: inconsistent vendoring'
+
+-- $WORK/auto/go.mod --
+module example.com/auto
+
+go 1.13
+
+require example.com/printversion v1.0.0
+
+replace (
+ example.com/unused => nonexistent.example.com/unused v1.0.0-whatever
+ example.com/version v1.0.0 => ./replacement-version
+ example.com/version v1.2.0 => nonexistent.example.com/version v1.2.0
+)
+-- $WORK/auto/tools.go --
+// +build tools
+
+package auto
+
+import _ "example.com/printversion"
+-- $WORK/auto/auto.go --
+package auto
+-- $WORK/auto/replacement-version/go.mod --
+module example.com/version
+-- $WORK/auto/replacement-version/version.go --
+package version
+
+const V = "v1.0.0-replaced"
+-- $WORK/modules-1.14.txt --
+# example.com/printversion v1.0.0
+## explicit
+example.com/printversion
+# example.com/version v1.0.0 => ./replacement-version
+example.com/version
+# example.com/unused => nonexistent.example.com/unused v1.0.0-whatever
+# example.com/version v1.2.0 => nonexistent.example.com/version v1.2.0
+-- $WORK/modules-1.13.txt --
+# example.com/printversion v1.0.0
+example.com/printversion
+# example.com/version v1.0.0 => ./replacement-version
+example.com/version
+-- $WORK/modules-bad-1.13.txt --
+# example.com/printversion v1.1.0
+example.com/printversion
+# example.com/version v1.1.0
+example.com/version
+-- $WORK/auto/vendor/example.com/printversion/go.mod --
+module example.com/printversion
+
+require example.com/version v1.0.0
+replace example.com/version v1.0.0 => ../oops v0.0.0
+exclude example.com/version v1.0.1
+-- $WORK/auto/vendor/example.com/printversion/printversion.go --
+package main
+
+import (
+ "fmt"
+ "os"
+ "runtime/debug"
+
+ _ "example.com/version"
+)
+
+func main() {
+ info, _ := debug.ReadBuildInfo()
+ fmt.Fprintf(os.Stdout, "path is %s\n", info.Path)
+ fmt.Fprintf(os.Stdout, "main is %s %s\n", info.Main.Path, info.Main.Version)
+ for _, m := range info.Deps {
+ fmt.Fprintf(os.Stdout, "using %s %s\n", m.Path, m.Version)
+ }
+}
+-- $WORK/auto/vendor/example.com/version/version.go --
+package version
+
+const V = "v1.0.0-replaced"
diff --git a/libgo/go/cmd/go/testdata/script/mod_vendor_build.txt b/libgo/go/cmd/go/testdata/script/mod_vendor_build.txt
index 24920a36b66..0c359cea6e9 100644
--- a/libgo/go/cmd/go/testdata/script/mod_vendor_build.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_vendor_build.txt
@@ -32,7 +32,7 @@ stdout m
-- go.mod --
module m
-
+go 1.12
-- x.go --
package x
import _ "rsc.io/quote"
diff --git a/libgo/go/cmd/go/testdata/script/mod_vendor_replace.txt b/libgo/go/cmd/go/testdata/script/mod_vendor_replace.txt
index 6bc1c77ed3d..0c1c1d22f5b 100644
--- a/libgo/go/cmd/go/testdata/script/mod_vendor_replace.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_vendor_replace.txt
@@ -1,7 +1,7 @@
env GO111MODULE=on
# Before vendoring, we expect to see the original directory.
-go list -f '{{.Version}} {{.Dir}}' -m rsc.io/quote/v3
+go list -f '{{with .Module}}{{.Version}}{{end}} {{.Dir}}' rsc.io/quote/v3
stdout 'v3.0.0'
stdout '.*[/\\]not-rsc.io[/\\]quote[/\\]v3'
@@ -15,12 +15,22 @@ go mod vendor
# without attempting to look up the non-replaced version.
cmp vendor/rsc.io/quote/v3/quote.go local/not-rsc.io/quote/v3/quote.go
-go list -mod=vendor -f '{{.Version}} {{.Dir}}' -m rsc.io/quote/v3
+go list -mod=vendor -f '{{with .Module}}{{.Version}}{{end}} {{.Dir}}' rsc.io/quote/v3
stdout 'v3.0.0'
stdout '.*[/\\]vendor[/\\]rsc.io[/\\]quote[/\\]v3'
! stderr 'finding'
! stderr 'lookup disabled'
+# 'go list' should provide the original replacement directory as the module's
+# replacement path.
+go list -mod=vendor -f '{{with .Module}}{{with .Replace}}{{.Path}}{{end}}{{end}}' rsc.io/quote/v3
+stdout '.*[/\\]not-rsc.io[/\\]quote[/\\]v3'
+
+# The same module can't be used as two different paths.
+cd multiple-paths
+! go mod vendor
+stderr 'rsc.io/quote/v3@v3.0.0 used for two different module paths \(not-rsc.io/quote/v3 and rsc.io/quote/v3\)'
+
-- go.mod --
module example.com/replace
@@ -37,3 +47,20 @@ module not-rsc.io/quote/v3
-- local/not-rsc.io/quote/v3/quote.go --
package quote
+
+-- multiple-paths/main.go --
+package main
+import (
+ "fmt"
+ "rsc.io/quote/v3"
+)
+func main() {
+ fmt.Println(quote.GoV3())
+}
+-- multiple-paths/go.mod --
+module quoter
+require (
+ rsc.io/quote/v3 v3.0.0
+ not-rsc.io/quote/v3 v3.0.0
+)
+replace not-rsc.io/quote/v3 => rsc.io/quote/v3 v3.0.0
diff --git a/libgo/go/cmd/go/testdata/script/mod_vendor_unused.txt b/libgo/go/cmd/go/testdata/script/mod_vendor_unused.txt
new file mode 100644
index 00000000000..96251bb25ae
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_vendor_unused.txt
@@ -0,0 +1,67 @@
+# Auxiliary test for inclusion of otherwise-unused replacements in
+# vendor/modules.txt for golang.org/issue/33848.
+# We need metadata about replacements in order to verify that modules.txt
+# remains in sync with the main module's go.mod file.
+
+env GO111MODULE=on
+
+go mod vendor
+cmp go1.14-modules.txt vendor/modules.txt
+
+-- go.mod --
+module example.com/foo
+go 1.14
+
+require (
+ example.com/a v0.1.0
+)
+
+replace (
+ example.com/a v0.1.0 => ./a
+ example.com/b v0.1.0 => ./b1
+ example.com/b v0.2.0-unused => ./b2
+ example.com/c => ./c
+ example.com/d v0.1.0 => ./d1
+ example.com/d v0.2.0 => ./d2
+ example.com/e => example.com/e v0.1.0-unused
+)
+-- foo.go --
+package foo
+import _ "example.com/a"
+-- a/go.mod --
+module example.com/a
+require (
+ example.com/b v0.1.0 // indirect
+ example.com/c v0.1.0 // indirect
+)
+-- a/a.go --
+package a
+import _ "example.com/d"
+-- b1/go.mod --
+module example.com/b
+require example.com/d v0.1.0
+-- b2/go.mod --
+module example.com/b
+require example.com/c v0.2.0
+-- c/go.mod --
+module example.com/c
+require example.com/d v0.2.0
+-- d1/go.mod --
+module example.com/d
+-- d1/d1.go --
+package d
+-- d2/go.mod --
+module example.com/d
+-- d2/d2.go --
+package d
+-- go1.14-modules.txt --
+# example.com/a v0.1.0 => ./a
+## explicit
+example.com/a
+# example.com/d v0.2.0 => ./d2
+example.com/d
+# example.com/b v0.1.0 => ./b1
+# example.com/b v0.2.0-unused => ./b2
+# example.com/c => ./c
+# example.com/d v0.1.0 => ./d1
+# example.com/e => example.com/e v0.1.0-unused
diff --git a/libgo/go/cmd/go/testdata/script/modfile_flag.txt b/libgo/go/cmd/go/testdata/script/modfile_flag.txt
new file mode 100644
index 00000000000..1409be9599c
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/modfile_flag.txt
@@ -0,0 +1,84 @@
+# Tests the behavior of the -modfile flag in commands that support it.
+# The go.mod file exists but should not be read or written.
+# Same with go.sum.
+
+env GOFLAGS=-modfile=go.alt.mod
+cp go.mod go.mod.orig
+cp go.sum go.sum.orig
+
+
+# go mod init should create a new file, even though go.mod already exists.
+go mod init example.com/m
+grep example.com/m go.alt.mod
+
+# go mod edit should operate on the alternate file
+go mod edit -require rsc.io/quote@v1.5.2
+grep rsc.io/quote go.alt.mod
+
+# other 'go mod' commands should work. 'go mod vendor' is tested later.
+go mod download rsc.io/quote
+go mod graph
+stdout rsc.io/quote
+go mod tidy
+grep rsc.io/quote go.alt.sum
+go mod verify
+go mod why rsc.io/quote
+
+
+# 'go list' and other commands with build flags should work.
+# They should update the alternate go.mod when a dependency is missing.
+go mod edit -droprequire rsc.io/quote
+go list .
+grep rsc.io/quote go.alt.mod
+go build -n .
+go test -n .
+go get -d rsc.io/quote
+
+
+# 'go mod vendor' should work.
+go mod vendor
+exists vendor
+
+# Automatic vendoring should be broken by editing an explicit requirement
+# in the alternate go.mod file.
+go mod edit -require rsc.io/quote@v1.5.1
+! go list .
+go list -mod=mod
+rm vendor
+
+
+# 'go generate' should use the alternate file when resolving packages.
+# Recursive go commands started with 'go generate' should not get an explicitly
+# passed -modfile, but they should see arguments from GOFLAGS.
+cp go.alt.mod go.gen.mod
+env OLD_GOFLAGS=$GOFLAGS
+env GOFLAGS=-modfile=go.gen.mod
+go generate -modfile=go.alt.mod .
+env GOFLAGS=$OLD_GOFLAGS
+grep example.com/exclude go.gen.mod
+! grep example.com/exclude go.alt.mod
+
+
+# The original files should not have been modified.
+cmp go.mod go.mod.orig
+cmp go.sum go.sum.orig
+
+
+# If the altnernate mod file does not have a ".mod" suffix, an error
+# should be reported.
+cp go.alt.mod goaltmod
+! go mod tidy -modfile=goaltmod
+stderr '-modfile=goaltmod: file does not have .mod extension'
+
+-- go.mod --
+ʕ◔ϖ◔ʔ
+-- go.sum --
+ʕ◔ϖ◔ʔ
+-- use.go --
+package main
+
+import _ "rsc.io/quote"
+-- gen.go --
+//go:generate go mod edit -exclude example.com/exclude@v1.0.0
+
+package main
diff --git a/libgo/go/cmd/go/testdata/script/noncanonical_import.txt b/libgo/go/cmd/go/testdata/script/noncanonical_import.txt
new file mode 100644
index 00000000000..7fdc0718ef1
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/noncanonical_import.txt
@@ -0,0 +1,21 @@
+env GO111MODULE=off
+
+! go build canonical/d
+stderr 'package canonical/d'
+stderr 'imports canonical/b'
+stderr 'imports canonical/a/: non-canonical'
+
+-- canonical/a/a.go --
+package a
+
+import _ "c"
+-- canonical/b/b.go --
+package b
+
+import _ "canonical/a/"
+-- canonical/a/vendor/c/c.go --
+package c
+-- canonical/d/d.go --
+package d
+
+import _ "canonical/b"
diff --git a/libgo/go/cmd/go/testdata/script/test_bad_example.txt b/libgo/go/cmd/go/testdata/script/test_bad_example.txt
new file mode 100644
index 00000000000..1d147b663fe
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/test_bad_example.txt
@@ -0,0 +1,13 @@
+# Tests that invalid examples are ignored.
+# Verifies golang.org/issue/35284
+go test x_test.go
+
+-- x_test.go --
+package x
+
+import "fmt"
+
+func ExampleThisShouldNotHaveAParameter(thisShouldntExist int) {
+ fmt.Println("X")
+ // Output:
+} \ No newline at end of file
diff --git a/libgo/go/cmd/go/testdata/script/test_cache_inputs.txt b/libgo/go/cmd/go/testdata/script/test_cache_inputs.txt
new file mode 100644
index 00000000000..46faca0f422
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/test_cache_inputs.txt
@@ -0,0 +1,230 @@
+env GO111MODULE=off
+
+# Test that cached test results are invalidated in response to
+# changes to the external inputs to the test.
+
+[short] skip
+[GODEBUG:gocacheverify=1] skip
+
+# We're testing cache behavior, so start with a clean GOCACHE.
+env GOCACHE=$WORK/cache
+
+# Build a helper binary to invoke os.Chtimes.
+go build -o mkold$GOEXE mkold.go
+
+# Make test input files appear to be a minute old.
+exec ./mkold$GOEXE 1m testcache/file.txt
+exec ./mkold$GOEXE 1m testcache/script.sh
+
+# If the test reads an environment variable, changes to that variable
+# should invalidate cached test results.
+env TESTKEY=x
+go test testcache -run=TestLookupEnv
+go test testcache -run=TestLookupEnv
+stdout '\(cached\)'
+
+env TESTKEY=y
+go test testcache -run=TestLookupEnv
+! stdout '\(cached\)'
+go test testcache -run=TestLookupEnv
+stdout '\(cached\)'
+
+# If the test stats a file, changes to the file should invalidate the cache.
+go test testcache -run=FileSize
+go test testcache -run=FileSize
+stdout '\(cached\)'
+
+cp 4x.txt testcache/file.txt
+go test testcache -run=FileSize
+! stdout '\(cached\)'
+go test testcache -run=FileSize
+stdout '\(cached\)'
+
+# Files should be tracked even if the test changes its working directory.
+go test testcache -run=Chdir
+go test testcache -run=Chdir
+stdout '\(cached\)'
+cp 6x.txt testcache/file.txt
+go test testcache -run=Chdir
+! stdout '\(cached\)'
+go test testcache -run=Chdir
+stdout '\(cached\)'
+
+# The content of files should affect caching, provided that the mtime also changes.
+exec ./mkold$GOEXE 1m testcache/file.txt
+go test testcache -run=FileContent
+go test testcache -run=FileContent
+stdout '\(cached\)'
+cp 2y.txt testcache/file.txt
+exec ./mkold$GOEXE 50s testcache/file.txt
+go test testcache -run=FileContent
+! stdout '\(cached\)'
+go test testcache -run=FileContent
+stdout '\(cached\)'
+
+# Directory contents read via os.ReadDirNames should affect caching.
+go test testcache -run=DirList
+go test testcache -run=DirList
+stdout '\(cached\)'
+rm testcache/file.txt
+go test testcache -run=DirList
+! stdout '\(cached\)'
+go test testcache -run=DirList
+stdout '\(cached\)'
+
+# Files outside GOROOT and GOPATH should not affect caching.
+env TEST_EXTERNAL_FILE=$WORK/external.txt
+go test testcache -run=ExternalFile
+go test testcache -run=ExternalFile
+stdout '\(cached\)'
+
+rm $WORK/external.txt
+go test testcache -run=ExternalFile
+stdout '\(cached\)'
+
+# Executables within GOROOT and GOPATH should affect caching,
+# even if the test does not stat them explicitly.
+
+[!exec:/bin/sh] skip
+chmod 0755 ./testcache/script.sh
+
+exec ./mkold$GOEXEC 1m testcache/script.sh
+go test testcache -run=Exec
+go test testcache -run=Exec
+stdout '\(cached\)'
+
+exec ./mkold$GOEXE 50s testcache/script.sh
+go test testcache -run=Exec
+! stdout '\(cached\)'
+go test testcache -run=Exec
+stdout '\(cached\)'
+
+-- testcache/file.txt --
+xx
+-- 4x.txt --
+xxxx
+-- 6x.txt --
+xxxxxx
+-- 2y.txt --
+yy
+-- $WORK/external.txt --
+This file is outside of GOPATH.
+-- testcache/script.sh --
+#!/bin/sh
+exit 0
+-- testcache/testcache_test.go --
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package testcache
+
+import (
+ "io/ioutil"
+ "os"
+ "testing"
+)
+
+func TestChdir(t *testing.T) {
+ os.Chdir("..")
+ defer os.Chdir("testcache")
+ info, err := os.Stat("testcache/file.txt")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if info.Size()%2 != 1 {
+ t.Fatal("even file")
+ }
+}
+
+func TestOddFileContent(t *testing.T) {
+ f, err := os.Open("file.txt")
+ if err != nil {
+ t.Fatal(err)
+ }
+ data, err := ioutil.ReadAll(f)
+ f.Close()
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(data)%2 != 1 {
+ t.Fatal("even file")
+ }
+}
+
+func TestOddFileSize(t *testing.T) {
+ info, err := os.Stat("file.txt")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if info.Size()%2 != 1 {
+ t.Fatal("even file")
+ }
+}
+
+func TestOddGetenv(t *testing.T) {
+ val := os.Getenv("TESTKEY")
+ if len(val)%2 != 1 {
+ t.Fatal("even env value")
+ }
+}
+
+func TestLookupEnv(t *testing.T) {
+ _, ok := os.LookupEnv("TESTKEY")
+ if !ok {
+ t.Fatal("env missing")
+ }
+}
+
+func TestDirList(t *testing.T) {
+ f, err := os.Open(".")
+ if err != nil {
+ t.Fatal(err)
+ }
+ f.Readdirnames(-1)
+ f.Close()
+}
+
+func TestExec(t *testing.T) {
+ // Note: not using os/exec to make sure there is no unexpected stat.
+ p, err := os.StartProcess("./script.sh", []string{"script"}, new(os.ProcAttr))
+ if err != nil {
+ t.Fatal(err)
+ }
+ ps, err := p.Wait()
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !ps.Success() {
+ t.Fatalf("script failed: %v", err)
+ }
+}
+
+func TestExternalFile(t *testing.T) {
+ os.Open(os.Getenv("TEST_EXTERNAL_FILE"))
+ _, err := os.Stat(os.Getenv("TEST_EXTERNAL_FILE"))
+ if err != nil {
+ t.Fatal(err)
+ }
+}
+-- mkold.go --
+package main
+
+import (
+ "log"
+ "os"
+ "time"
+)
+
+func main() {
+ d, err := time.ParseDuration(os.Args[1])
+ if err != nil {
+ log.Fatal(err)
+ }
+ path := os.Args[2]
+ old := time.Now().Add(-d)
+ err = os.Chtimes(path, old, old)
+ if err != nil {
+ log.Fatal(err)
+ }
+}
diff --git a/libgo/go/cmd/go/testdata/script/test_compile_binary.txt b/libgo/go/cmd/go/testdata/script/test_compile_binary.txt
index 6562f2453ff..63bb8ec3e78 100644
--- a/libgo/go/cmd/go/testdata/script/test_compile_binary.txt
+++ b/libgo/go/cmd/go/testdata/script/test_compile_binary.txt
@@ -4,5 +4,5 @@ env GO111MODULE=off
stderr 'build comment'
-- compile_binary/foo_test.go --
-//+build foo
+// +build foo
package foo
diff --git a/libgo/go/cmd/go/testdata/script/test_compile_tempfile.txt b/libgo/go/cmd/go/testdata/script/test_compile_tempfile.txt
new file mode 100644
index 00000000000..912410814f4
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/test_compile_tempfile.txt
@@ -0,0 +1,11 @@
+[short] skip
+
+# Ensure that the target of 'go build -o' can be an existing, empty file so that
+# its name can be reserved using ioutil.TempFile or the 'mktemp` command.
+
+go build -o empty-file$GOEXE main.go
+
+-- main.go --
+package main
+func main() {}
+-- empty-file$GOEXE --
diff --git a/libgo/go/cmd/go/testdata/script/test_devnull.txt b/libgo/go/cmd/go/testdata/script/test_devnull.txt
deleted file mode 100644
index 33071679a29..00000000000
--- a/libgo/go/cmd/go/testdata/script/test_devnull.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-env GO111MODULE=off
-
-# go test -c -o NUL
-# should work (see golang.org/issue/28035).
-cd x
-go test -o=$devnull -c
-! exists x.test$GOEXE
-
--- x/x_test.go --
-package x_test
-import (
- "testing"
-)
-func TestNUL(t *testing.T) {
-}
diff --git a/libgo/go/cmd/go/testdata/script/test_main_archive.txt b/libgo/go/cmd/go/testdata/script/test_main_archive.txt
new file mode 100644
index 00000000000..410d923d237
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/test_main_archive.txt
@@ -0,0 +1,32 @@
+env GO111MODULE=off
+
+# Test that a main_test of 'package main' imports the package,
+# not the installed binary.
+
+[short] skip
+
+env GOBIN=$WORK/bin
+go test main_test
+go install main_test
+
+go list -f '{{.Stale}}' main_test
+stdout false
+
+go test main_test
+
+-- main_test/m.go --
+package main
+
+func F() {}
+func main() {}
+-- main_test/m_test.go --
+package main_test
+
+import (
+ . "main_test"
+ "testing"
+)
+
+func Test1(t *testing.T) {
+ F()
+}
diff --git a/libgo/go/cmd/go/testdata/script/test_rebuildall.txt b/libgo/go/cmd/go/testdata/script/test_rebuildall.txt
new file mode 100644
index 00000000000..38233c18922
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/test_rebuildall.txt
@@ -0,0 +1,14 @@
+env GO111MODULE=off
+
+# Regression test for golang.org/issue/6844:
+# 'go test -a' should force dependencies in the standard library to be rebuilt.
+
+[short] skip
+
+go test -x -a -c testdata/dep_test.go
+stderr '^.*[/\\]compile'$GOEXE'["]? (.* )?regexp .*[/\\]regexp\.go'
+
+-- testdata/dep_test.go --
+package deps
+
+import _ "testing"
diff --git a/libgo/go/cmd/go/testdata/script/test_timeout.txt b/libgo/go/cmd/go/testdata/script/test_timeout.txt
index 8dead0a439a..4de4df45082 100644
--- a/libgo/go/cmd/go/testdata/script/test_timeout.txt
+++ b/libgo/go/cmd/go/testdata/script/test_timeout.txt
@@ -2,12 +2,13 @@
env GO111MODULE=off
cd a
-# No timeout is passed via 'go test' command.
-go test -v
+# If no timeout is set explicitly, 'go test' should set
+# -test.timeout to its internal deadline.
+go test -v . --
stdout '10m0s'
-# Timeout is passed via 'go test' command.
-go test -v -timeout 30m
+# An explicit -timeout argument should be propagated to -test.timeout.
+go test -v -timeout 30m . --
stdout '30m0s'
-- a/timeout_test.go --
@@ -19,4 +20,4 @@ import (
)
func TestTimeout(t *testing.T) {
fmt.Println(flag.Lookup("test.timeout").Value.String())
-} \ No newline at end of file
+}
diff --git a/libgo/go/cmd/go/testdata/script/version.txt b/libgo/go/cmd/go/testdata/script/version.txt
index 9086f047e4b..42526247f1e 100644
--- a/libgo/go/cmd/go/testdata/script/version.txt
+++ b/libgo/go/cmd/go/testdata/script/version.txt
@@ -1,6 +1,7 @@
env GO111MODULE=on
[short] skip
+# Check that 'go version' and 'go version -m' work on a binary built in module mode.
go build -o fortune.exe rsc.io/fortune
go version fortune.exe
stdout '^fortune.exe: .+'
@@ -8,6 +9,10 @@ go version -m fortune.exe
stdout '^\tpath\trsc.io/fortune'
stdout '^\tmod\trsc.io/fortune\tv1.0.0'
+# Repeat the test with -buildmode=pie.
+# TODO(golang.org/issue/27144): don't skip after -buildmode=pie is implemented
+# on Windows.
+[windows] skip # -buildmode=pie not supported
go build -buildmode=pie -o external.exe rsc.io/fortune
go version external.exe
stdout '^external.exe: .+'
diff --git a/libgo/go/cmd/go/testdata/script/vet_flags.txt b/libgo/go/cmd/go/testdata/script/vet_flags.txt
new file mode 100644
index 00000000000..94bfd126c09
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/vet_flags.txt
@@ -0,0 +1,37 @@
+env GO111MODULE=on
+
+# gccgo doesn't support vet on the standard library
+[gccgo] skip
+
+# Regression test for issue 35837: "go vet -<analyzer> <std package>"
+# did not apply the requested analyzer.
+go vet -n -unreachable=false encoding/binary
+stderr '-unreachable=false'
+! stderr '-unsafeptr=false'
+
+[short] stop
+env GOCACHE=$WORK/gocache
+env GOTMPDIR=$WORK/tmp
+go env GOTMPDIR
+stdout '/tmp'
+
+# "go test" on a user package should by default enable an explicit whitelist of analyzers.
+go test -x -run=none .
+stderr '[/\\]vet'$GOEXE'["]? .* -errorsas .* ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
+
+# "go test" on a standard package should by default disable an explicit blacklist.
+go test -x -run=none encoding/binary
+stderr '[/\\]vet'$GOEXE'["]? -unsafeptr=false ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
+
+# Both should allow users to override via the -vet flag.
+go test -x -vet=unreachable -run=none .
+stderr '[/\\]vet'$GOEXE'["]? -unreachable ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
+go test -x -vet=unreachable -run=none encoding/binary
+stderr '[/\\]vet'$GOEXE'["]? -unreachable ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
+
+-- go.mod --
+module example.com/x
+-- x.go --
+package x
+-- x_test.go --
+package x
diff --git a/libgo/go/cmd/go/testdata/src/canonical/a/a.go b/libgo/go/cmd/go/testdata/src/canonical/a/a.go
deleted file mode 100644
index 486cc4843fd..00000000000
--- a/libgo/go/cmd/go/testdata/src/canonical/a/a.go
+++ /dev/null
@@ -1,3 +0,0 @@
-package a
-
-import _ "c"
diff --git a/libgo/go/cmd/go/testdata/src/canonical/a/vendor/c/c.go b/libgo/go/cmd/go/testdata/src/canonical/a/vendor/c/c.go
deleted file mode 100644
index 7f96c221c2d..00000000000
--- a/libgo/go/cmd/go/testdata/src/canonical/a/vendor/c/c.go
+++ /dev/null
@@ -1 +0,0 @@
-package c
diff --git a/libgo/go/cmd/go/testdata/src/canonical/b/b.go b/libgo/go/cmd/go/testdata/src/canonical/b/b.go
deleted file mode 100644
index ce0f4ce3035..00000000000
--- a/libgo/go/cmd/go/testdata/src/canonical/b/b.go
+++ /dev/null
@@ -1,3 +0,0 @@
-package b
-
-import _ "canonical/a/"
diff --git a/libgo/go/cmd/go/testdata/src/canonical/d/d.go b/libgo/go/cmd/go/testdata/src/canonical/d/d.go
deleted file mode 100644
index ef7dd7dd461..00000000000
--- a/libgo/go/cmd/go/testdata/src/canonical/d/d.go
+++ /dev/null
@@ -1,3 +0,0 @@
-package d
-
-import _ "canonical/b"
diff --git a/libgo/go/cmd/go/testdata/src/go-cmd-test/helloworld.go b/libgo/go/cmd/go/testdata/src/go-cmd-test/helloworld.go
deleted file mode 100644
index 002a5c740c7..00000000000
--- a/libgo/go/cmd/go/testdata/src/go-cmd-test/helloworld.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package main
-
-func main() {
- println("hello world")
-}
diff --git a/libgo/go/cmd/go/testdata/src/main_test/m.go b/libgo/go/cmd/go/testdata/src/main_test/m.go
deleted file mode 100644
index c682f030b4e..00000000000
--- a/libgo/go/cmd/go/testdata/src/main_test/m.go
+++ /dev/null
@@ -1,4 +0,0 @@
-package main
-
-func F() {}
-func main() {}
diff --git a/libgo/go/cmd/go/testdata/src/main_test/m_test.go b/libgo/go/cmd/go/testdata/src/main_test/m_test.go
deleted file mode 100644
index f865b7734f0..00000000000
--- a/libgo/go/cmd/go/testdata/src/main_test/m_test.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package main_test
-
-import (
- . "main_test"
- "testing"
-)
-
-func Test1(t *testing.T) {
- F()
-}
diff --git a/libgo/go/cmd/go/testdata/src/testcache/testcache_test.go b/libgo/go/cmd/go/testdata/src/testcache/testcache_test.go
deleted file mode 100644
index 9b2d1ea7824..00000000000
--- a/libgo/go/cmd/go/testdata/src/testcache/testcache_test.go
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package testcache
-
-import (
- "io/ioutil"
- "os"
- "runtime"
- "testing"
-)
-
-func TestChdir(t *testing.T) {
- os.Chdir("..")
- defer os.Chdir("testcache")
- info, err := os.Stat("testcache/file.txt")
- if err != nil {
- t.Fatal(err)
- }
- if info.Size()%2 != 1 {
- t.Fatal("even file")
- }
-}
-
-func TestOddFileContent(t *testing.T) {
- f, err := os.Open("file.txt")
- if err != nil {
- t.Fatal(err)
- }
- data, err := ioutil.ReadAll(f)
- f.Close()
- if err != nil {
- t.Fatal(err)
- }
- if len(data)%2 != 1 {
- t.Fatal("even file")
- }
-}
-
-func TestOddFileSize(t *testing.T) {
- info, err := os.Stat("file.txt")
- if err != nil {
- t.Fatal(err)
- }
- if info.Size()%2 != 1 {
- t.Fatal("even file")
- }
-}
-
-func TestOddGetenv(t *testing.T) {
- val := os.Getenv("TESTKEY")
- if len(val)%2 != 1 {
- t.Fatal("even env value")
- }
-}
-
-func TestLookupEnv(t *testing.T) {
- _, ok := os.LookupEnv("TESTKEY")
- if !ok {
- t.Fatal("env missing")
- }
-}
-
-func TestDirList(t *testing.T) {
- f, err := os.Open(".")
- if err != nil {
- t.Fatal(err)
- }
- f.Readdirnames(-1)
- f.Close()
-}
-
-func TestExec(t *testing.T) {
- if runtime.GOOS == "plan9" || runtime.GOOS == "windows" || runtime.GOOS == "nacl" {
- t.Skip("non-unix")
- }
-
- // Note: not using os/exec to make sure there is no unexpected stat.
- p, err := os.StartProcess("./script.sh", []string{"script"}, new(os.ProcAttr))
- if err != nil {
- t.Fatal(err)
- }
- ps, err := p.Wait()
- if err != nil {
- t.Fatal(err)
- }
- if !ps.Success() {
- t.Fatalf("script failed: %v", err)
- }
-}
diff --git a/libgo/go/cmd/gofmt/gofmt.go b/libgo/go/cmd/gofmt/gofmt.go
index d7a77a96823..9e472b2d51c 100644
--- a/libgo/go/cmd/gofmt/gofmt.go
+++ b/libgo/go/cmd/gofmt/gofmt.go
@@ -16,11 +16,12 @@ import (
"io"
"io/ioutil"
"os"
- "os/exec"
"path/filepath"
"runtime"
"runtime/pprof"
"strings"
+
+ "cmd/internal/diff"
)
var (
@@ -141,7 +142,7 @@ func processFile(filename string, in io.Reader, out io.Writer, stdin bool) error
}
}
if *doDiff {
- data, err := diff(src, res, filename)
+ data, err := diffWithReplaceTempFile(src, res, filename)
if err != nil {
return fmt.Errorf("computing diff: %s", err)
}
@@ -227,47 +228,12 @@ func gofmtMain() {
}
}
-func writeTempFile(dir, prefix string, data []byte) (string, error) {
- file, err := ioutil.TempFile(dir, prefix)
- if err != nil {
- return "", err
- }
- _, err = file.Write(data)
- if err1 := file.Close(); err == nil {
- err = err1
- }
- if err != nil {
- os.Remove(file.Name())
- return "", err
- }
- return file.Name(), nil
-}
-
-func diff(b1, b2 []byte, filename string) (data []byte, err error) {
- f1, err := writeTempFile("", "gofmt", b1)
- if err != nil {
- return
- }
- defer os.Remove(f1)
-
- f2, err := writeTempFile("", "gofmt", b2)
- if err != nil {
- return
- }
- defer os.Remove(f2)
-
- cmd := "diff"
- if runtime.GOOS == "plan9" {
- cmd = "/bin/ape/diff"
- }
-
- data, err = exec.Command(cmd, "-u", f1, f2).CombinedOutput()
+func diffWithReplaceTempFile(b1, b2 []byte, filename string) ([]byte, error) {
+ data, err := diff.Diff("gofmt", b1, b2)
if len(data) > 0 {
- // diff exits with a non-zero status when the files don't match.
- // Ignore that failure as long as we get output.
return replaceTempFilename(data, filename)
}
- return
+ return data, err
}
// replaceTempFilename replaces temporary filenames in diff with actual one.
diff --git a/libgo/go/cmd/gofmt/gofmt_test.go b/libgo/go/cmd/gofmt/gofmt_test.go
index 3008365cd23..98d3eb7eb27 100644
--- a/libgo/go/cmd/gofmt/gofmt_test.go
+++ b/libgo/go/cmd/gofmt/gofmt_test.go
@@ -112,7 +112,7 @@ func runTest(t *testing.T, in, out string) {
}
t.Errorf("(gofmt %s) != %s (see %s.gofmt)", in, out, in)
- d, err := diff(expected, got, in)
+ d, err := diffWithReplaceTempFile(expected, got, in)
if err == nil {
t.Errorf("%s", d)
}
@@ -194,7 +194,7 @@ func TestDiff(t *testing.T) {
in := []byte("first\nsecond\n")
out := []byte("first\nthird\n")
filename := "difftest.txt"
- b, err := diff(in, out, filename)
+ b, err := diffWithReplaceTempFile(in, out, filename)
if err != nil {
t.Fatal(err)
}
diff --git a/libgo/go/cmd/gofmt/rewrite.go b/libgo/go/cmd/gofmt/rewrite.go
index 79b7858a5af..bab22e04cda 100644
--- a/libgo/go/cmd/gofmt/rewrite.go
+++ b/libgo/go/cmd/gofmt/rewrite.go
@@ -271,6 +271,12 @@ func subst(m map[string]reflect.Value, pattern reflect.Value, pos reflect.Value)
// Otherwise copy.
switch p := pattern; p.Kind() {
case reflect.Slice:
+ if p.IsNil() {
+ // Do not turn nil slices into empty slices. go/ast
+ // guarantees that certain lists will be nil if not
+ // populated.
+ return reflect.Zero(p.Type())
+ }
v := reflect.MakeSlice(p.Type(), p.Len(), p.Len())
for i := 0; i < p.Len(); i++ {
v.Index(i).Set(subst(m, p.Index(i), pos))
diff --git a/libgo/go/cmd/gofmt/testdata/import.golden b/libgo/go/cmd/gofmt/testdata/import.golden
index 29bdc9baf4a..1125b70cb76 100644
--- a/libgo/go/cmd/gofmt/testdata/import.golden
+++ b/libgo/go/cmd/gofmt/testdata/import.golden
@@ -1,3 +1,4 @@
+// package comment
package main
import (
@@ -10,11 +11,6 @@ import (
import (
"fmt"
- "math"
-)
-
-import (
- "fmt"
"math"
@@ -25,6 +21,10 @@ import (
"io"
)
+// We reset the line numbering to test that
+// the formatting works independent of line directives
+//line :19
+
import (
"errors"
"fmt"
@@ -129,3 +129,66 @@ import (
"dedup_by_group"
)
+
+import (
+ "fmt" // for Printf
+ /* comment */ io1 "io"
+ /* comment */ io2 "io"
+ /* comment */ "log"
+)
+
+import (
+ "fmt"
+ /* comment */ io1 "io"
+ /* comment */ io2 "io" // hello
+ "math" /* right side */
+ // end
+)
+
+import (
+ "errors" // for New
+ "fmt"
+ /* comment */ io1 "io" /* before */ // after
+ io2 "io" // another
+ // end
+)
+
+import (
+ "errors" // for New
+ /* left */ "fmt" /* right */
+ "log" // for Fatal
+ /* left */ "math" /* right */
+)
+
+import /* why */ /* comment here? */ (
+ /* comment */ "fmt"
+ "math"
+)
+
+// Reset it again
+//line :100
+
+// Dedup with different import styles
+import (
+ "path"
+ . "path"
+ _ "path"
+ pathpkg "path"
+)
+
+/* comment */
+import (
+ "fmt"
+ "math" // for Abs
+ // This is a new run
+ "errors"
+ "fmt"
+)
+
+// End an import declaration in the same line
+// as the last import. See golang.org/issue/33538.
+// Note: Must be the last (or 2nd last) line of the file.
+import (
+ "fmt"
+ "math"
+)
diff --git a/libgo/go/cmd/gofmt/testdata/import.input b/libgo/go/cmd/gofmt/testdata/import.input
index 78ab4f65443..040b8722d47 100644
--- a/libgo/go/cmd/gofmt/testdata/import.input
+++ b/libgo/go/cmd/gofmt/testdata/import.input
@@ -1,3 +1,4 @@
+// package comment
package main
import (
@@ -8,9 +9,6 @@ import (
"io"
)
-import("fmt"
-"math")
-
import (
"fmt"
@@ -23,6 +21,10 @@ import (
"io"
)
+// We reset the line numbering to test that
+// the formatting works independent of line directives
+//line :19
+
import (
"fmt"
"math"
@@ -132,3 +134,66 @@ import (
"dedup_by_group"
)
+
+import (
+ /* comment */ io1 "io"
+ "fmt" // for Printf
+ /* comment */ "log"
+ /* comment */ io2 "io"
+)
+
+import (
+ /* comment */ io2 "io" // hello
+ /* comment */ io1 "io"
+ "math" /* right side */
+ "fmt"
+ // end
+)
+
+import (
+ /* comment */ io1 "io" /* before */ // after
+ "fmt"
+ "errors" // for New
+ io2 "io" // another
+ // end
+)
+
+import (
+ /* left */ "fmt" /* right */
+ "errors" // for New
+ /* left */ "math" /* right */
+ "log" // for Fatal
+)
+
+import /* why */ /* comment here? */ (
+ /* comment */ "fmt"
+ "math"
+)
+
+// Reset it again
+//line :100
+
+// Dedup with different import styles
+import (
+ "path"
+ . "path"
+ _ "path"
+ "path"
+ pathpkg "path"
+)
+
+/* comment */
+import (
+ "math" // for Abs
+ "fmt"
+ // This is a new run
+ "errors"
+ "fmt"
+ "errors"
+)
+
+// End an import declaration in the same line
+// as the last import. See golang.org/issue/33538.
+// Note: Must be the last (or 2nd last) line of the file.
+import("fmt"
+"math") \ No newline at end of file
diff --git a/libgo/go/cmd/gofmt/testdata/issue28082.golden b/libgo/go/cmd/gofmt/testdata/issue28082.golden
new file mode 100644
index 00000000000..5837fd52912
--- /dev/null
+++ b/libgo/go/cmd/gofmt/testdata/issue28082.golden
@@ -0,0 +1,13 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+// testcase for issue #28082
+
+func foo() {}
+
+func main() {}
+
+func bar() {}
diff --git a/libgo/go/cmd/gofmt/testdata/issue28082.input b/libgo/go/cmd/gofmt/testdata/issue28082.input
new file mode 100644
index 00000000000..ab7d2186cea
--- /dev/null
+++ b/libgo/go/cmd/gofmt/testdata/issue28082.input
@@ -0,0 +1,13 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+// testcase for issue #28082
+
+func foo( ) {}
+
+func main( ) {}
+
+func bar() {}
diff --git a/libgo/go/cmd/gofmt/testdata/rewrite10.golden b/libgo/go/cmd/gofmt/testdata/rewrite10.golden
new file mode 100644
index 00000000000..1dd781fbb09
--- /dev/null
+++ b/libgo/go/cmd/gofmt/testdata/rewrite10.golden
@@ -0,0 +1,19 @@
+//gofmt -r=a->a
+
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 33103, 33104, and 33105.
+
+package pkg
+
+func fn() {
+ _ = func() {
+ switch {
+ default:
+ }
+ }
+ _ = func() string {}
+ _ = func() { var ptr *string; println(ptr) }
+}
diff --git a/libgo/go/cmd/gofmt/testdata/rewrite10.input b/libgo/go/cmd/gofmt/testdata/rewrite10.input
new file mode 100644
index 00000000000..1dd781fbb09
--- /dev/null
+++ b/libgo/go/cmd/gofmt/testdata/rewrite10.input
@@ -0,0 +1,19 @@
+//gofmt -r=a->a
+
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 33103, 33104, and 33105.
+
+package pkg
+
+func fn() {
+ _ = func() {
+ switch {
+ default:
+ }
+ }
+ _ = func() string {}
+ _ = func() { var ptr *string; println(ptr) }
+}
diff --git a/libgo/go/cmd/internal/buildid/buildid_test.go b/libgo/go/cmd/internal/buildid/buildid_test.go
index 15481dd7623..904c2c6f377 100644
--- a/libgo/go/cmd/internal/buildid/buildid_test.go
+++ b/libgo/go/cmd/internal/buildid/buildid_test.go
@@ -7,6 +7,7 @@ package buildid
import (
"bytes"
"crypto/sha256"
+ "internal/obscuretestdata"
"io/ioutil"
"os"
"reflect"
@@ -19,13 +20,6 @@ const (
)
func TestReadFile(t *testing.T) {
- var files = []string{
- "p.a",
- "a.elf",
- "a.macho",
- "a.pe",
- }
-
f, err := ioutil.TempFile("", "buildid-test-")
if err != nil {
t.Fatal(err)
@@ -34,26 +28,43 @@ func TestReadFile(t *testing.T) {
defer os.Remove(tmp)
f.Close()
- for _, f := range files {
- id, err := ReadFile("testdata/" + f)
+ // Use obscured files to prevent Apple’s notarization service from
+ // mistaking them as candidates for notarization and rejecting the entire
+ // toolchain.
+ // See golang.org/issue/34986
+ var files = []string{
+ "p.a.base64",
+ "a.elf.base64",
+ "a.macho.base64",
+ "a.pe.base64",
+ }
+
+ for _, name := range files {
+ f, err := obscuretestdata.DecodeToTempFile("testdata/" + name)
+ if err != nil {
+ t.Errorf("obscuretestdata.DecodeToTempFile(testdata/%s): %v", name, err)
+ continue
+ }
+ defer os.Remove(f)
+ id, err := ReadFile(f)
if id != expectedID || err != nil {
t.Errorf("ReadFile(testdata/%s) = %q, %v, want %q, nil", f, id, err, expectedID)
}
old := readSize
readSize = 2048
- id, err = ReadFile("testdata/" + f)
+ id, err = ReadFile(f)
readSize = old
if id != expectedID || err != nil {
- t.Errorf("ReadFile(testdata/%s) [readSize=2k] = %q, %v, want %q, nil", f, id, err, expectedID)
+ t.Errorf("ReadFile(%s) [readSize=2k] = %q, %v, want %q, nil", f, id, err, expectedID)
}
- data, err := ioutil.ReadFile("testdata/" + f)
+ data, err := ioutil.ReadFile(f)
if err != nil {
t.Fatal(err)
}
m, _, err := FindAndHash(bytes.NewReader(data), expectedID, 1024)
if err != nil {
- t.Errorf("FindAndHash(testdata/%s): %v", f, err)
+ t.Errorf("FindAndHash(%s): %v", f, err)
continue
}
if err := ioutil.WriteFile(tmp, data, 0666); err != nil {
@@ -68,7 +79,7 @@ func TestReadFile(t *testing.T) {
err = Rewrite(tf, m, newID)
err2 := tf.Close()
if err != nil {
- t.Errorf("Rewrite(testdata/%s): %v", f, err)
+ t.Errorf("Rewrite(%s): %v", f, err)
continue
}
if err2 != nil {
@@ -77,7 +88,7 @@ func TestReadFile(t *testing.T) {
id, err = ReadFile(tmp)
if id != newID || err != nil {
- t.Errorf("ReadFile(testdata/%s after Rewrite) = %q, %v, want %q, nil", f, id, err, newID)
+ t.Errorf("ReadFile(%s after Rewrite) = %q, %v, want %q, nil", f, id, err, newID)
}
}
}
diff --git a/libgo/go/cmd/internal/buildid/testdata/a.elf b/libgo/go/cmd/internal/buildid/testdata/a.elf
deleted file mode 100644
index f63128921aa..00000000000
--- a/libgo/go/cmd/internal/buildid/testdata/a.elf
+++ /dev/null
Binary files differ
diff --git a/libgo/go/cmd/internal/buildid/testdata/a.elf.base64 b/libgo/go/cmd/internal/buildid/testdata/a.elf.base64
new file mode 100644
index 00000000000..fa855217358
--- /dev/null
+++ b/libgo/go/cmd/internal/buildid/testdata/a.elf.base64
@@ -0,0 +1 @@
+f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAAABBAAAAAAABAAAAAAAAAAMgBAAAAAAAAAAAAAEAAOAAHAEAADQADAAYAAAAEAAAAQAAAAAAAAABAAEAAAAAAAEAAQAAAAAAAiAEAAAAAAACIAQAAAAAAAAAQAAAAAAAABAAAAAQAAACUDwAAAAAAAJQPQAAAAAAAlA9AAAAAAABsAAAAAAAAAGwAAAAAAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAABAQAAAAAAAAEBAAAAAAAAAAEAAAAAAAAAEAAAAEAAAAACAAAAAAAAAAIEAAAAAAAAAgQAAAAAAAfgEAAAAAAAB+AQAAAAAAAAAQAAAAAAAAAQAAAAYAAAAAMAAAAAAAAAAwQAAAAAAAADBAAAAAAADgAQAAAAAAAOABAAAAAAAAABAAAAAAAABR5XRkBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAIAVBGUAKgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAABgAAAAAAAAAAEEAAAAAAAAAQAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAABBAAAAAQAAAAIAAAAAAAAAACBAAAAAAAAAIAAAAAAAADgAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAcgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAQCAAAAAAAAB8AAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAEkAAAABAAAAAgAAAAAAAAC8IEAAAAAAALwgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAABTAAAAAQAAAAIAAAAAAAAAvCBAAAAAAAC8IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXQAAAAEAAAACAAAAAAAAALwgQAAAAAAAvCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAGcAAAABAAAAAgAAAAAAAADAIEAAAAAAAMAgAAAAAAAAvgAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAMAAAAAAAAAADBAAAAAAAAAMAAAAAAAAOABAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAEgAAAAgAAAADAAAAAAAAAOAxQAAAAAAA4DEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAIAAAAAwAAAAAAAADgMUAAAAAAAOAxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdAAAACAAAAAMAAAAAAAAA4DFAAAAAAADgMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJwAAAAcAAAACAAAAAAAAAJQPQAAAAAAAlA8AAAAAAABsAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAABbAAAABAAAAEdvAABhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ei4xMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0AMPMzMzMzMzMzMzMzMzMzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAEEAAAAAAAAAAAAAAAAAAAC50ZXh0AC5ub3B0cmRhdGEALmRhdGEALmJzcwAubm9wdHJic3MALm5vdGUuZ28uYnVpbGRpZAAuZWxmZGF0YQAucm9kYXRhAC50eXBlbGluawAuaXRhYmxpbmsALmdvc3ltdGFiAC5nb3BjbG50YWIALnNoc3RydGFiAAAAAAD7////AAABCAEAAAAAAAAAABBAAAAAAAAwAAAAAAAAAAEQQAAAAAAAgAAAAAAAAAAAEEAAAAAAAGgAAAAAAAAAZ0UjAXMAAAB2AAAAeQAAAAAAAAACAAAAACBAAAAAAAAAIEAAAAAAAG1haW4ubWFpbgAAAgEABAEABgEAAAAAAAIAAACIAAAAL1VzZXJzL3JzYy9nby9zcmMvY21kL2ludGVybmFsL2J1aWxkaWQvdGVzdGRhdGEvcC5nbwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIDBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAIEAAAAAAAL4AAAAAAAAAvgAAAAAAAADQIEAAAAAAAAIAAAAAAAAAAgAAAAAAAABAIUAAAAAAAAIAAAAAAAAAAgAAAAAAAAAMIEAAAAAAAAAQQAAAAAAAARBAAAAAAAAAEEAAAAAAABAQQAAAAAAAADBAAAAAAADgMUAAAAAAAOAxQAAAAAAA4DFAAAAAAADgMUAAAAAAAOAxQAAAAAAA4DFAAAAAAADgMUAAAAAAAOAxQAAAAAAACSBAAAAAAAAIIEAAAAAAAAAgQAAAAAAAOCBAAAAAAAAgIEAAAAAAAAEAAAAAAAAAAQAAAAAAAAC8IEAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8IEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
diff --git a/libgo/go/cmd/internal/buildid/testdata/a.macho b/libgo/go/cmd/internal/buildid/testdata/a.macho
deleted file mode 100644
index fbbd57c1fe3..00000000000
--- a/libgo/go/cmd/internal/buildid/testdata/a.macho
+++ /dev/null
Binary files differ
diff --git a/libgo/go/cmd/internal/buildid/testdata/a.macho.base64 b/libgo/go/cmd/internal/buildid/testdata/a.macho.base64
new file mode 100644
index 00000000000..2e9f6a7dff3
--- /dev/null
+++ b/libgo/go/cmd/internal/buildid/testdata/a.macho.base64
@@ -0,0 +1 @@
+z/rt/gcAAAEDAAAAAgAAAAkAAAAwBgAAAQAAAAAAAAAZAAAASAAAAF9fUEFHRVpFUk8AAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZAAAAeAIAAF9fVEVYVAAAAAAAAAAAAAAAAAABAAAAAAAgAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAcAAAAFAAAABwAAAAAAAABfX3RleHQAAAAAAAAAAAAAX19URVhUAAAAAAAAAAAAAAAQAAEAAAAAgAAAAAAAAAAAEAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAF9fcm9kYXRhAAAAAAAAAABfX1RFWFQAAAAAAAAAAAAAgBAAAQAAAAA4AAAAAAAAAIAQAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX19zeW1ib2xfc3R1YjEAAF9fVEVYVAAAAAAAAAAAAAC4EAABAAAAAAAAAAAAAAAAuBAAAAAAAAAAAAAAAAAAAAgEAIAAAAAABgAAAAAAAABfX3R5cGVsaW5rAAAAAAAAX19URVhUAAAAAAAAAAAAALgQAAEAAAAAAAAAAAAAAAC4EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF9faXRhYmxpbmsAAAAAAABfX1RFWFQAAAAAAAAAAAAAuBAAAQAAAAAAAAAAAAAAALgQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX19nb3N5bXRhYgAAAAAAAF9fVEVYVAAAAAAAAAAAAAC4EAABAAAAAAAAAAAAAAAAuBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABfX2dvcGNsbnRhYgAAAAAAX19URVhUAAAAAAAAAAAAAMAQAAEAAAAABgEAAAAAAADAEAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkAAADYAQAAX19EQVRBAAAAAAAAAAAAAAAgAAEAAAAA4AEAAAAAAAAAIAAAAAAAAOABAAAAAAAAAwAAAAMAAAAFAAAAAAAAAF9fbmxfc3ltYm9sX3B0cgBfX0RBVEEAAAAAAAAAAAAAACAAAQAAAAAAAAAAAAAAAAAgAAACAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAX19ub3B0cmRhdGEAAAAAAF9fREFUQQAAAAAAAAAAAAAAIAABAAAAAOABAAAAAAAAACAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABfX2RhdGEAAAAAAAAAAAAAX19EQVRBAAAAAAAAAAAAAOAhAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAF9fYnNzAAAAAAAAAAAAAABfX0RBVEEAAAAAAAAAAAAA4CEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAX19ub3B0cmJzcwAAAAAAAF9fREFUQQAAAAAAAAAAAADgIQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAZAAAASAAAAF9fTElOS0VESVQAAAAAAAAAMAABAAAAAKAEAAAAAAAAADAAAAAAAACgBAAAAAAAAAcAAAADAAAAAAAAAAAAAAAFAAAAuAAAAAQAAAAqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwEAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAABgAAAAAMAAAJQAAAFAyAABQAgAACwAAAFAAAAAAAAAAJQAAACUAAAAAAAAAJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAIAAAAAwAAAAvdXNyL2xpYi9keWxkAAAAAAAAACQAAAAQAAAAAAcKAAAHCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8gR28gYnVpbGQgSUQ6ICJhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ei4xMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0Igog/8zDzMzMzMzMzMzMzMzMzMzMAQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAABAAAQAAAAAAAAAAAAAAAPv///8AAAEIAgAAAAAAAAAAEAABAAAAAEAAAAAAAAAAcBAAAQAAAAB4AAAAAAAAAHEQAAEAAAAAyAAAAAAAAAAAEAABAAAAAGgAAAAAAAAAZ0UjAQAAAAAAAAAAAAAAAAAAAAAAAAAAZ28uYnVpbGRpZAAAAAAAAHAQAAEAAAAAsAAAAAAAAABnRSMBuwAAAL4AAADBAAAAAAAAAAIAAACAEAABAAAAAIAQAAEAAAAAbWFpbi5tYWluAAACAQAEAQAGAQAAAAAAAgAAANAAAAAvVXNlcnMvcnNjL2dvL3NyYy9jbWQvaW50ZXJuYWwvYnVpbGRpZC90ZXN0ZGF0YS9wLmdvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgIAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAQAAEAAAAABgEAAAAAAAAGAQAAAAAAANAQAAEAAAAAAwAAAAAAAAADAAAAAAAAAIgRAAEAAAAAAgAAAAAAAAACAAAAAAAAAIwQAAEAAAAAABAAAQAAAABxEAABAAAAAAAQAAEAAAAAgBAAAQAAAAAAIAABAAAAAOAhAAEAAAAA4CEAAQAAAADgIQABAAAAAOAhAAEAAAAA4CEAAQAAAADgIQABAAAAAOAhAAEAAAAA4CEAAQAAAACJEAABAAAAAIgQAAEAAAAAgBAAAQAAAAC4EAABAAAAAKAQAAEAAAAAAQAAAAAAAAABAAAAAAAAALgQAAEAAAAAAAAAAAAAAAAAAAAAAAAAALgQAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAA4BAAAAEAABAAAAAA0AAAAOAgAAgBAAAQAAAAAXAAAADgIAAIAQAAEAAAAAIwAAAA4BAABwEAABAAAAAC0AAAAOCwAA4CEAAQAAAAA5AAAADgoAAOAhAAEAAAAARgAAAA4LAADgIQABAAAAAFMAAAAOCgAA4CEAAQAAAABhAAAADgIAAIkQAAEAAAAAcAAAAA4CAACKEAABAAAAAIAAAAAOBQAAuBAAAQAAAACSAAAADgwAAOAhAAEAAAAAngAAAA4MAADgIQABAAAAALAAAAAOCQAA4CEAAQAAAADDAAAADgcAAMYRAAEAAAAA1AAAAA4CAAC4EAABAAAAAOQAAAAOBgAAuBAAAQAAAAD0AAAADgEAAIAQAAEAAAAAAgEAAA4CAAC4EAABAAAAABEBAAAOAgAAjBAAAQAAAAAlAQAADgkAACAgAAEAAAAAPQEAAA4CAACKEAABAAAAAFoBAAAOAgAAiBAAAQAAAABrAQAADgIAAIgQAAEAAAAAeQEAAA4CAACJEAABAAAAAIgBAAAOBQAAuBAAAQAAAACZAQAADgkAAAAgAAEAAAAAsQEAAA4MAADgIQABAAAAAMIBAAAOCQAAACAAAQAAAADUAQAADgcAAMAQAAEAAAAA5AEAAA4CAACAEAABAAAAAPMBAAAOBgAAuBAAAQAAAAACAgAADgEAAAAQAAEAAAAADwIAAA4CAACgEAABAAAAACYCAAAOBAAAuBAAAQAAAAA3AgAADgIAAIAQAAEAAAAARQIAAA4CAACAEAABAAAAACAAZ28uYnVpbGRpZABnby5mdW5jLioAZ28uc3RyaW5nLioAbWFpbi5tYWluAHJ1bnRpbWUuYnNzAHJ1bnRpbWUuZGF0YQBydW50aW1lLmVic3MAcnVudGltZS5lZGF0YQBydW50aW1lLmVnY2JzcwBydW50aW1lLmVnY2RhdGEAcnVudGltZS5laXRhYmxpbmsAcnVudGltZS5lbmQAcnVudGltZS5lbm9wdHJic3MAcnVudGltZS5lbm9wdHJkYXRhAHJ1bnRpbWUuZXBjbG50YWIAcnVudGltZS5lcm9kYXRhAHJ1bnRpbWUuZXN5bXRhYgBydW50aW1lLmV0ZXh0AHJ1bnRpbWUuZXR5cGVzAHJ1bnRpbWUuZmluZGZ1bmN0YWIAcnVudGltZS5maXJzdG1vZHVsZWRhdGEAcnVudGltZS5mcmFtZXBvaW50ZXJfZW5hYmxlZABydW50aW1lLmdjYml0cy4qAHJ1bnRpbWUuZ2Nic3MAcnVudGltZS5nY2RhdGEAcnVudGltZS5pdGFibGluawBydW50aW1lLmxhc3Rtb2R1bGVkYXRhcABydW50aW1lLm5vcHRyYnNzAHJ1bnRpbWUubm9wdHJkYXRhAHJ1bnRpbWUucGNsbnRhYgBydW50aW1lLnJvZGF0YQBydW50aW1lLnN5bXRhYgBydW50aW1lLnRleHQAcnVudGltZS50ZXh0c2VjdGlvbm1hcABydW50aW1lLnR5cGVsaW5rAHJ1bnRpbWUudHlwZXMAdHlwZS4qAAAAAAA=
diff --git a/libgo/go/cmd/internal/buildid/testdata/a.pe b/libgo/go/cmd/internal/buildid/testdata/a.pe
deleted file mode 100644
index 91202728c3f..00000000000
--- a/libgo/go/cmd/internal/buildid/testdata/a.pe
+++ /dev/null
Binary files differ
diff --git a/libgo/go/cmd/internal/buildid/testdata/a.pe.base64 b/libgo/go/cmd/internal/buildid/testdata/a.pe.base64
new file mode 100644
index 00000000000..d3a31a3a627
--- /dev/null
+++ b/libgo/go/cmd/internal/buildid/testdata/a.pe.base64
@@ -0,0 +1 @@
+TVqQAAMABAAAAAAA//8AAIsAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAAZIYEAAAAAAAADAAAAAAAAPAAIwILAgMAAAIAAAACAAAAAAAAcBAAAAAQAAAAAEAAAAAAAAAQAAAAAgAABAAAAAEAAAAEAAAAAAAAAABQAAAABgAAAAAAAAMAAAAAACAAAAAAAADgHwAAAAAAAAAQAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAMAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAudGV4dAAAAMYBAAAAEAAAAAIAAAAGAAAAAAAAAAAAAAAAAABgAABgLmRhdGEAAADgAQAAACAAAAACAAAACAAAAAAAAAAAAAAAAAAAQAAAwC5pZGF0YQAAFAAAAAAwAAAAAgAAAAoAAAAAAAAAAAAAAAAAAEAAAMAuc3ltdGFiAAQAAAAAQAAAAAIAAAAMAAAAAAAAAAAAAAAAAAAAAABCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/yBHbyBidWlsZCBJRDogImFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6LjEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQiCiD/zMPMzMzMzMzMzMzMzMzMzMwBAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAEEAAAAAAAAAAAAAAAAAA+////wAAAQgCAAAAAAAAAAAQQAAAAAAAQAAAAAAAAABwEEAAAAAAAHgAAAAAAAAAcRBAAAAAAADIAAAAAAAAAAAQQAAAAAAAaAAAAAAAAABnRSMBAAAAAAAAAAAAAAAAAAAAAAAAAABnby5idWlsZGlkAAAAAAAAcBBAAAAAAACwAAAAAAAAAGdFIwG7AAAAvgAAAMEAAAAAAAAAAgAAAIAQQAAAAAAAgBBAAAAAAABtYWluLm1haW4AAAIBAAQBAAYBAAAAAAACAAAA0AAAAC9Vc2Vycy9yc2MvZ28vc3JjL2NtZC9pbnRlcm5hbC9idWlsZGlkL3Rlc3RkYXRhL3AuZ28AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgIEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAQQAAAAAAABgEAAAAAAAAGAQAAAAAAANAQQAAAAAAAAwAAAAAAAAADAAAAAAAAAIgRQAAAAAAAAgAAAAAAAAACAAAAAAAAAIwQQAAAAAAAABBAAAAAAABxEEAAAAAAAAAQQAAAAAAAgBBAAAAAAAAAIEAAAAAAAOAhQAAAAAAA4CFAAAAAAADgIUAAAAAAAOAhQAAAAAAA4CFAAAAAAADgIUAAAAAAAOAhQAAAAAAA4CFAAAAAAACJEEAAAAAAAIgQQAAAAAAAgBBAAAAAAAC4EEAAAAAAAKAQQAAAAAAAAQAAAAAAAAABAAAAAAAAALgQQAAAAAAAAAAAAAAAAAAAAAAAAAAAALgQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
diff --git a/libgo/go/cmd/internal/buildid/testdata/p.a b/libgo/go/cmd/internal/buildid/testdata/p.a
deleted file mode 100644
index dcc3e76ef8b..00000000000
--- a/libgo/go/cmd/internal/buildid/testdata/p.a
+++ /dev/null
Binary files differ
diff --git a/libgo/go/cmd/internal/buildid/testdata/p.a.base64 b/libgo/go/cmd/internal/buildid/testdata/p.a.base64
new file mode 100644
index 00000000000..ba96c10ca50
--- /dev/null
+++ b/libgo/go/cmd/internal/buildid/testdata/p.a.base64
@@ -0,0 +1 @@
+ITxhcmNoPgpfXy5QS0dERUYgICAgICAgMCAgICAgICAgICAgMCAgICAgMCAgICAgNjQ0ICAgICAzMzAgICAgICAgYApnbyBvYmplY3QgZGFyd2luIGFtZDY0IGRldmVsICszYjMzYWY1ZDY4IFRodSBPY3QgNSAxNjo1OTowMCAyMDE3IC0wNDAwIFg6ZnJhbWVwb2ludGVyCmJ1aWxkIGlkICJhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ei4xMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0IgotLS0tCgpidWlsZCBpZCAiYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXouMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNCIKCiQkQgp2ZXJzaW9uIDUKCgACAQFwAAsACwABAAokJApfZ29fLm8gICAgICAgICAgMCAgICAgICAgICAgMCAgICAgMCAgICAgNjQ0ICAgICAyMjMgICAgICAgYApnbyBvYmplY3QgZGFyd2luIGFtZDY0IGRldmVsICszYjMzYWY1ZDY4IFRodSBPY3QgNSAxNjo1OTowMCAyMDE3IC0wNDAwIFg6ZnJhbWVwb2ludGVyCmJ1aWxkIGlkICJhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ei4xMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0IgotLS0tCgoKIQoAAGdvMTlsZAEA/wAAAAAAAP//Z28xOWxkAA==
diff --git a/libgo/go/cmd/internal/diff/diff.go b/libgo/go/cmd/internal/diff/diff.go
new file mode 100644
index 00000000000..e9d2c237800
--- /dev/null
+++ b/libgo/go/cmd/internal/diff/diff.go
@@ -0,0 +1,58 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package diff implements a Diff function that compare two inputs
+// using the 'diff' tool.
+package diff
+
+import (
+ "io/ioutil"
+ "os"
+ "os/exec"
+ "runtime"
+)
+
+// Returns diff of two arrays of bytes in diff tool format.
+func Diff(prefix string, b1, b2 []byte) ([]byte, error) {
+ f1, err := writeTempFile(prefix, b1)
+ if err != nil {
+ return nil, err
+ }
+ defer os.Remove(f1)
+
+ f2, err := writeTempFile(prefix, b2)
+ if err != nil {
+ return nil, err
+ }
+ defer os.Remove(f2)
+
+ cmd := "diff"
+ if runtime.GOOS == "plan9" {
+ cmd = "/bin/ape/diff"
+ }
+
+ data, err := exec.Command(cmd, "-u", f1, f2).CombinedOutput()
+ if len(data) > 0 {
+ // diff exits with a non-zero status when the files don't match.
+ // Ignore that failure as long as we get output.
+ err = nil
+ }
+ return data, err
+}
+
+func writeTempFile(prefix string, data []byte) (string, error) {
+ file, err := ioutil.TempFile("", prefix)
+ if err != nil {
+ return "", err
+ }
+ _, err = file.Write(data)
+ if err1 := file.Close(); err == nil {
+ err = err1
+ }
+ if err != nil {
+ os.Remove(file.Name())
+ return "", err
+ }
+ return file.Name(), nil
+}
diff --git a/libgo/go/cmd/internal/objabi/doc.go b/libgo/go/cmd/internal/objabi/doc.go
index 03dc9fb88bc..08e922b11fb 100644
--- a/libgo/go/cmd/internal/objabi/doc.go
+++ b/libgo/go/cmd/internal/objabi/doc.go
@@ -22,10 +22,12 @@
//
// The file format is:
//
-// - magic header: "\x00go112ld"
+// - magic header: "\x00go114ld"
// - byte 1 - version number
// - sequence of strings giving dependencies (imported packages)
// - empty string (marks end of sequence)
+// - number of entries in the following sequence
+// - sequence of filename strings to generate debug information
// - sequence of symbol references used by the defined symbols
// - byte 0xff (marks end of sequence)
// - sequence of integer lengths:
@@ -38,7 +40,7 @@
// - data, the content of the defined symbols
// - sequence of defined symbols
// - byte 0xff (marks end of sequence)
-// - magic footer: "\xffgo112ld"
+// - magic footer: "\xffgo114ld"
//
// All integers are stored in a zigzag varint format.
// See golang.org/s/go12symtab for a definition.
diff --git a/libgo/go/cmd/internal/objabi/funcdata.go b/libgo/go/cmd/internal/objabi/funcdata.go
index addbd2ac88b..08b75eb9fed 100644
--- a/libgo/go/cmd/internal/objabi/funcdata.go
+++ b/libgo/go/cmd/internal/objabi/funcdata.go
@@ -15,11 +15,12 @@ const (
PCDATA_StackMapIndex = 1
PCDATA_InlTreeIndex = 2
- FUNCDATA_ArgsPointerMaps = 0
- FUNCDATA_LocalsPointerMaps = 1
- FUNCDATA_RegPointerMaps = 2
- FUNCDATA_StackObjects = 3
- FUNCDATA_InlTree = 4
+ FUNCDATA_ArgsPointerMaps = 0
+ FUNCDATA_LocalsPointerMaps = 1
+ FUNCDATA_RegPointerMaps = 2
+ FUNCDATA_StackObjects = 3
+ FUNCDATA_InlTree = 4
+ FUNCDATA_OpenCodedDeferInfo = 5
// ArgsSizeUnknown is set in Func.argsize to mark all functions
// whose argument size is unknown (C vararg functions, and
diff --git a/libgo/go/cmd/internal/objabi/funcid.go b/libgo/go/cmd/internal/objabi/funcid.go
index a30bc3fa05a..0fda1db1789 100644
--- a/libgo/go/cmd/internal/objabi/funcid.go
+++ b/libgo/go/cmd/internal/objabi/funcid.go
@@ -37,6 +37,8 @@ const (
FuncID_debugCallV1
FuncID_gopanic
FuncID_panicwrap
+ FuncID_handleAsyncEvent
+ FuncID_asyncPreempt
FuncID_wrapper // any autogenerated code (hash/eq algorithms, method wrappers, etc.)
)
@@ -82,6 +84,19 @@ func GetFuncID(name, file string) FuncID {
return FuncID_gopanic
case "runtime.panicwrap":
return FuncID_panicwrap
+ case "runtime.handleAsyncEvent":
+ return FuncID_handleAsyncEvent
+ case "runtime.asyncPreempt":
+ return FuncID_asyncPreempt
+ case "runtime.deferreturn":
+ // Don't show in the call stack (used when invoking defer functions)
+ return FuncID_wrapper
+ case "runtime.runOpenDeferFrame":
+ // Don't show in the call stack (used when invoking defer functions)
+ return FuncID_wrapper
+ case "runtime.reflectcallSave":
+ // Don't show in the call stack (used when invoking defer functions)
+ return FuncID_wrapper
}
if file == "<autogenerated>" {
return FuncID_wrapper
diff --git a/libgo/go/cmd/internal/objabi/head.go b/libgo/go/cmd/internal/objabi/head.go
index 0a542282284..6836c338c93 100644
--- a/libgo/go/cmd/internal/objabi/head.go
+++ b/libgo/go/cmd/internal/objabi/head.go
@@ -42,7 +42,6 @@ const (
Hfreebsd
Hjs
Hlinux
- Hnacl
Hnetbsd
Hopenbsd
Hplan9
@@ -65,8 +64,6 @@ func (h *HeadType) Set(s string) error {
*h = Hjs
case "linux", "android":
*h = Hlinux
- case "nacl":
- *h = Hnacl
case "netbsd":
*h = Hnetbsd
case "openbsd":
@@ -97,8 +94,6 @@ func (h *HeadType) String() string {
return "js"
case Hlinux:
return "linux"
- case Hnacl:
- return "nacl"
case Hnetbsd:
return "netbsd"
case Hopenbsd:
diff --git a/libgo/go/cmd/internal/objabi/reloctype.go b/libgo/go/cmd/internal/objabi/reloctype.go
index 5dc9356fe17..dc6482802af 100644
--- a/libgo/go/cmd/internal/objabi/reloctype.go
+++ b/libgo/go/cmd/internal/objabi/reloctype.go
@@ -64,6 +64,8 @@ const (
// R_CALLMIPS (only used on mips64) resolves to non-PC-relative target address
// of a CALL (JAL) instruction, by encoding the address into the instruction.
R_CALLMIPS
+ // R_CALLRISCV marks RISC-V CALLs for stack checking.
+ R_CALLRISCV
R_CONST
R_PCREL
// R_TLS_LE, used on 386, amd64, and ARM, resolves to the offset of the
@@ -200,6 +202,16 @@ const (
// relocated symbol rather than the symbol's address.
R_ADDRPOWER_TOCREL_DS
+ // RISC-V.
+
+ // R_RISCV_PCREL_ITYPE resolves a 32-bit PC-relative address using an
+ // AUIPC + I-type instruction pair.
+ R_RISCV_PCREL_ITYPE
+
+ // R_RISCV_PCREL_STYPE resolves a 32-bit PC-relative address using an
+ // AUIPC + S-type instruction pair.
+ R_RISCV_PCREL_STYPE
+
// R_PCRELDBL relocates s390x 2-byte aligned PC-relative addresses.
// TODO(mundaym): remove once variants can be serialized - see issue 14218.
R_PCRELDBL
@@ -210,6 +222,7 @@ const (
// R_ADDRMIPSTLS (only used on mips64) resolves to the low 16 bits of a TLS
// address (offset from thread pointer), by encoding it into the instruction.
R_ADDRMIPSTLS
+
// R_ADDRCUOFF resolves to a pointer-sized offset from the start of the
// symbol's DWARF compile unit.
R_ADDRCUOFF
@@ -223,16 +236,34 @@ const (
R_XCOFFREF
)
+// IsDirectCall reports whether r is a relocation for a direct call.
+// A direct call is a CALL instruction that takes the target address
+// as an immediate. The address is embedded into the instruction, possibly
+// with limited width. An indirect call is a CALL instruction that takes
+// the target address in register or memory.
+func (r RelocType) IsDirectCall() bool {
+ switch r {
+ case R_CALL, R_CALLARM, R_CALLARM64, R_CALLMIPS, R_CALLPOWER, R_CALLRISCV:
+ return true
+ }
+ return false
+}
+
// IsDirectJump reports whether r is a relocation for a direct jump.
-// A direct jump is a CALL or JMP instruction that takes the target address
-// as immediate. The address is embedded into the instruction, possibly
-// with limited width.
-// An indirect jump is a CALL or JMP instruction that takes the target address
-// in register or memory.
+// A direct jump is a JMP instruction that takes the target address
+// as an immediate. The address is embedded into the instruction, possibly
+// with limited width. An indirect jump is a JMP instruction that takes
+// the target address in register or memory.
func (r RelocType) IsDirectJump() bool {
switch r {
- case R_CALL, R_CALLARM, R_CALLARM64, R_CALLPOWER, R_CALLMIPS, R_JMPMIPS:
+ case R_JMPMIPS:
return true
}
return false
}
+
+// IsDirectCallOrJump reports whether r is a relocation for a direct
+// call or a direct jump.
+func (r RelocType) IsDirectCallOrJump() bool {
+ return r.IsDirectCall() || r.IsDirectJump()
+}
diff --git a/libgo/go/cmd/internal/objabi/reloctype_string.go b/libgo/go/cmd/internal/objabi/reloctype_string.go
index a1c4c1aa518..83dfe71e071 100644
--- a/libgo/go/cmd/internal/objabi/reloctype_string.go
+++ b/libgo/go/cmd/internal/objabi/reloctype_string.go
@@ -4,9 +4,9 @@ package objabi
import "strconv"
-const _RelocType_name = "R_ADDRR_ADDRPOWERR_ADDRARM64R_ADDRMIPSR_ADDROFFR_WEAKADDROFFR_SIZER_CALLR_CALLARMR_CALLARM64R_CALLINDR_CALLPOWERR_CALLMIPSR_CONSTR_PCRELR_TLS_LER_TLS_IER_GOTOFFR_PLT0R_PLT1R_PLT2R_USEFIELDR_USETYPER_METHODOFFR_POWER_TOCR_GOTPCRELR_JMPMIPSR_DWARFSECREFR_DWARFFILEREFR_ARM64_TLS_LER_ARM64_TLS_IER_ARM64_GOTPCRELR_ARM64_GOTR_ARM64_PCRELR_ARM64_LDST8R_ARM64_LDST32R_ARM64_LDST64R_ARM64_LDST128R_POWER_TLS_LER_POWER_TLS_IER_POWER_TLSR_ADDRPOWER_DSR_ADDRPOWER_GOTR_ADDRPOWER_PCRELR_ADDRPOWER_TOCRELR_ADDRPOWER_TOCREL_DSR_PCRELDBLR_ADDRMIPSUR_ADDRMIPSTLSR_ADDRCUOFFR_WASMIMPORTR_XCOFFREF"
+const _RelocType_name = "R_ADDRR_ADDRPOWERR_ADDRARM64R_ADDRMIPSR_ADDROFFR_WEAKADDROFFR_SIZER_CALLR_CALLARMR_CALLARM64R_CALLINDR_CALLPOWERR_CALLMIPSR_CALLRISCVR_CONSTR_PCRELR_TLS_LER_TLS_IER_GOTOFFR_PLT0R_PLT1R_PLT2R_USEFIELDR_USETYPER_METHODOFFR_POWER_TOCR_GOTPCRELR_JMPMIPSR_DWARFSECREFR_DWARFFILEREFR_ARM64_TLS_LER_ARM64_TLS_IER_ARM64_GOTPCRELR_ARM64_GOTR_ARM64_PCRELR_ARM64_LDST8R_ARM64_LDST32R_ARM64_LDST64R_ARM64_LDST128R_POWER_TLS_LER_POWER_TLS_IER_POWER_TLSR_ADDRPOWER_DSR_ADDRPOWER_GOTR_ADDRPOWER_PCRELR_ADDRPOWER_TOCRELR_ADDRPOWER_TOCREL_DSR_RISCV_PCREL_ITYPER_RISCV_PCREL_STYPER_PCRELDBLR_ADDRMIPSUR_ADDRMIPSTLSR_ADDRCUOFFR_WASMIMPORTR_XCOFFREF"
-var _RelocType_index = [...]uint16{0, 6, 17, 28, 38, 47, 60, 66, 72, 81, 92, 101, 112, 122, 129, 136, 144, 152, 160, 166, 172, 178, 188, 197, 208, 219, 229, 238, 251, 265, 279, 293, 309, 320, 333, 346, 360, 374, 389, 403, 417, 428, 442, 457, 474, 492, 513, 523, 534, 547, 558, 570, 580}
+var _RelocType_index = [...]uint16{0, 6, 17, 28, 38, 47, 60, 66, 72, 81, 92, 101, 112, 122, 133, 140, 147, 155, 163, 171, 177, 183, 189, 199, 208, 219, 230, 240, 249, 262, 276, 290, 304, 320, 331, 344, 357, 371, 385, 400, 414, 428, 439, 453, 468, 485, 503, 524, 543, 562, 572, 583, 596, 607, 619, 629}
func (i RelocType) String() string {
i -= 1
diff --git a/libgo/go/cmd/internal/objabi/stack.go b/libgo/go/cmd/internal/objabi/stack.go
index 62ab0398a66..7320dbf365f 100644
--- a/libgo/go/cmd/internal/objabi/stack.go
+++ b/libgo/go/cmd/internal/objabi/stack.go
@@ -18,7 +18,7 @@ const (
)
// Initialize StackGuard and StackLimit according to target system.
-var StackGuard = 880*stackGuardMultiplier() + StackSystem
+var StackGuard = 896*stackGuardMultiplier() + StackSystem
var StackLimit = StackGuard - StackSystem - StackSmall
// stackGuardMultiplier returns a multiplier to apply to the default
diff --git a/libgo/go/cmd/internal/objabi/symkind.go b/libgo/go/cmd/internal/objabi/symkind.go
index 16b4c535ed8..69f15286cde 100644
--- a/libgo/go/cmd/internal/objabi/symkind.go
+++ b/libgo/go/cmd/internal/objabi/symkind.go
@@ -59,7 +59,7 @@ const (
SDWARFINFO
SDWARFRANGE
SDWARFLOC
- SDWARFMISC
+ SDWARFLINES
// ABI alias. An ABI alias symbol is an empty symbol with a
// single relocation with 0 size that references the native
// function implementation symbol.
@@ -67,6 +67,8 @@ const (
// TODO(austin): Remove this and all uses once the compiler
// generates real ABI wrappers rather than symbol aliases.
SABIALIAS
+ // Coverage instrumentation counter for libfuzzer.
+ SLIBFUZZER_EXTRA_COUNTER
// Update cmd/link/internal/sym/AbiSymKindToSymKind for new SymKind values.
)
diff --git a/libgo/go/cmd/internal/objabi/util.go b/libgo/go/cmd/internal/objabi/util.go
index bf71b6b0c02..0e7693ee564 100644
--- a/libgo/go/cmd/internal/objabi/util.go
+++ b/libgo/go/cmd/internal/objabi/util.go
@@ -127,7 +127,7 @@ func init() {
}
func Framepointer_enabled(goos, goarch string) bool {
- return framepointer_enabled != 0 && (goarch == "amd64" && goos != "nacl" || goarch == "arm64" && goos == "linux")
+ return framepointer_enabled != 0 && (goarch == "amd64" || goarch == "arm64" && goos == "linux")
}
func addexp(s string) {
diff --git a/libgo/go/cmd/internal/sys/arch.go b/libgo/go/cmd/internal/sys/arch.go
index 487c9260e85..e8687363def 100644
--- a/libgo/go/cmd/internal/sys/arch.go
+++ b/libgo/go/cmd/internal/sys/arch.go
@@ -7,8 +7,7 @@ package sys
import "encoding/binary"
// ArchFamily represents a family of one or more related architectures.
-// For example, amd64 and amd64p32 are both members of the AMD64 family,
-// and ppc64 and ppc64le are both members of the PPC64 family.
+// For example, ppc64 and ppc64le are both members of the PPC64 family.
type ArchFamily byte
const (
@@ -20,6 +19,7 @@ const (
MIPS
MIPS64
PPC64
+ RISCV64
S390X
Wasm
)
@@ -71,15 +71,6 @@ var ArchAMD64 = &Arch{
MinLC: 1,
}
-var ArchAMD64P32 = &Arch{
- Name: "amd64p32",
- Family: AMD64,
- ByteOrder: binary.LittleEndian,
- PtrSize: 4,
- RegSize: 8,
- MinLC: 1,
-}
-
var ArchARM = &Arch{
Name: "arm",
Family: ARM,
@@ -152,6 +143,15 @@ var ArchPPC64LE = &Arch{
MinLC: 4,
}
+var ArchRISCV64 = &Arch{
+ Name: "riscv64",
+ Family: RISCV64,
+ ByteOrder: binary.LittleEndian,
+ PtrSize: 8,
+ RegSize: 8,
+ MinLC: 4,
+}
+
var ArchS390X = &Arch{
Name: "s390x",
Family: S390X,
@@ -173,7 +173,6 @@ var ArchWasm = &Arch{
var Archs = [...]*Arch{
Arch386,
ArchAMD64,
- ArchAMD64P32,
ArchARM,
ArchARM64,
ArchMIPS,
@@ -182,6 +181,7 @@ var Archs = [...]*Arch{
ArchMIPS64LE,
ArchPPC64,
ArchPPC64LE,
+ ArchRISCV64,
ArchS390X,
ArchWasm,
}
diff --git a/libgo/go/cmd/internal/sys/supported.go b/libgo/go/cmd/internal/sys/supported.go
index 4162858ac1b..02f833e945e 100644
--- a/libgo/go/cmd/internal/sys/supported.go
+++ b/libgo/go/cmd/internal/sys/supported.go
@@ -43,3 +43,71 @@ func MustLinkExternal(goos, goarch string) bool {
}
return false
}
+
+// BuildModeSupported reports whether goos/goarch supports the given build mode
+// using the given compiler.
+func BuildModeSupported(compiler, buildmode, goos, goarch string) bool {
+ if compiler == "gccgo" {
+ return true
+ }
+
+ platform := goos + "/" + goarch
+
+ switch buildmode {
+ case "archive":
+ return true
+
+ case "c-archive":
+ // TODO(bcmills): This seems dubious.
+ // Do we really support c-archive mode on js/wasm‽
+ return platform != "linux/ppc64"
+
+ case "c-shared":
+ switch platform {
+ case "linux/amd64", "linux/arm", "linux/arm64", "linux/386", "linux/ppc64le", "linux/s390x",
+ "android/amd64", "android/arm", "android/arm64", "android/386",
+ "freebsd/amd64",
+ "darwin/amd64", "darwin/386",
+ "windows/amd64", "windows/386":
+ return true
+ }
+ return false
+
+ case "default":
+ return true
+
+ case "exe":
+ return true
+
+ case "pie":
+ switch platform {
+ case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x",
+ "android/amd64", "android/arm", "android/arm64", "android/386",
+ "freebsd/amd64",
+ "darwin/amd64",
+ "aix/ppc64":
+ return true
+ }
+ return false
+
+ case "shared":
+ switch platform {
+ case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x":
+ return true
+ }
+ return false
+
+ case "plugin":
+ switch platform {
+ case "linux/amd64", "linux/arm", "linux/arm64", "linux/386", "linux/s390x", "linux/ppc64le",
+ "android/amd64", "android/arm", "android/arm64", "android/386",
+ "darwin/amd64",
+ "freebsd/amd64":
+ return true
+ }
+ return false
+
+ default:
+ return false
+ }
+}
diff --git a/libgo/go/cmd/vet/testdata/asm/asm.go b/libgo/go/cmd/vet/testdata/asm/asm.go
index 72ff452aae8..1e60d8bf941 100644
--- a/libgo/go/cmd/vet/testdata/asm/asm.go
+++ b/libgo/go/cmd/vet/testdata/asm/asm.go
@@ -7,3 +7,5 @@
package testdata
func arg1(x int8, y uint8)
+
+func cpx(x complex64, y complex128)
diff --git a/libgo/go/cmd/vet/testdata/asm/asm1.s b/libgo/go/cmd/vet/testdata/asm/asm1.s
new file mode 100644
index 00000000000..a5bb6dd0af8
--- /dev/null
+++ b/libgo/go/cmd/vet/testdata/asm/asm1.s
@@ -0,0 +1,23 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build amd64
+
+TEXT ·arg1(SB),0,$0-2
+ MOVW x+0(FP), AX // ERROR "\[amd64\] arg1: invalid MOVW of x\+0\(FP\); int8 is 1-byte value"
+
+TEXT ·cpx(SB),0,$0-24
+ // These are ok
+ MOVSS x_real+0(FP), X0
+ MOVSS x_imag+4(FP), X0
+ MOVSD y_real+8(FP), X0
+ MOVSD y_imag+16(FP), X0
+ // Loading both parts of a complex is ok: see issue 35264.
+ MOVSD x+0(FP), X0
+ MOVO y+8(FP), X0
+ MOVOU y+8(FP), X0
+
+ // These are not ok.
+ MOVO x+0(FP), X0 // ERROR "\[amd64\] cpx: invalid MOVO of x\+0\(FP\); complex64 is 8-byte value containing x_real\+0\(FP\) and x_imag\+4\(FP\)"
+ MOVSD y+8(FP), X0 // ERROR "\[amd64\] cpx: invalid MOVSD of y\+8\(FP\); complex128 is 16-byte value containing y_real\+8\(FP\) and y_imag\+16\(FP\)"
diff --git a/libgo/go/cmd/vet/testdata/print/print.go b/libgo/go/cmd/vet/testdata/print/print.go
index 7a4783aee4f..fca594925f7 100644
--- a/libgo/go/cmd/vet/testdata/print/print.go
+++ b/libgo/go/cmd/vet/testdata/print/print.go
@@ -81,8 +81,8 @@ func PrintfTests() {
fmt.Printf("%T %T", 3, i)
fmt.Printf("%U %U", 3, i)
fmt.Printf("%v %v", 3, i)
- fmt.Printf("%x %x %x %x", 3, i, "hi", s)
- fmt.Printf("%X %X %X %X", 3, i, "hi", s)
+ fmt.Printf("%x %x %x %x %x %x %x", 3, i, "hi", s, x, c, fslice)
+ fmt.Printf("%X %X %X %X %X %X %X", 3, i, "hi", s, x, c, fslice)
fmt.Printf("%.*s %d %g", 3, "hi", 23, 2.3)
fmt.Printf("%s", &stringerv)
fmt.Printf("%v", &stringerv)
@@ -125,7 +125,6 @@ func PrintfTests() {
fmt.Printf("%t", 23) // ERROR "Printf format %t has arg 23 of wrong type int"
fmt.Printf("%U", x) // ERROR "Printf format %U has arg x of wrong type float64"
fmt.Printf("%x", nil) // ERROR "Printf format %x has arg nil of wrong type untyped nil"
- fmt.Printf("%X", 2.3) // ERROR "Printf format %X has arg 2.3 of wrong type float64"
fmt.Printf("%s", stringerv) // ERROR "Printf format %s has arg stringerv of wrong type .*print.ptrStringer"
fmt.Printf("%t", stringerv) // ERROR "Printf format %t has arg stringerv of wrong type .*print.ptrStringer"
fmt.Printf("%s", embeddedStringerv) // ERROR "Printf format %s has arg embeddedStringerv of wrong type .*print.embeddedStringer"
diff --git a/libgo/go/cmd/vet/testdata/src/asm/asm1.s b/libgo/go/cmd/vet/testdata/src/asm/asm1.s
deleted file mode 100644
index c3ba986fb8b..00000000000
--- a/libgo/go/cmd/vet/testdata/src/asm/asm1.s
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build amd64
-
-TEXT ·arg1(SB),0,$0-2
- MOVW x+0(FP), AX // ERROR "\[amd64\] arg1: invalid MOVW of x\+0\(FP\); int8 is 1-byte value"