summaryrefslogtreecommitdiff
path: root/libgo/go/cmd/go/internal/modfetch/insecure.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/cmd/go/internal/modfetch/insecure.go')
-rw-r--r--libgo/go/cmd/go/internal/modfetch/insecure.go16
1 files changed, 16 insertions, 0 deletions
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)
+}