aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modload/init.go
diff options
context:
space:
mode:
authorJay Conrod <jayconrod@google.com>2020-10-19 14:02:14 -0400
committerJay Conrod <jayconrod@google.com>2020-10-20 18:46:31 +0000
commite2c420591cbbd684594a111fa5cdeb40c68964a5 (patch)
tree46d1377f47d6eb028c252dbc17f416b58c3f65cf /src/cmd/go/internal/modload/init.go
parent1b09d430678d4a6f73b2443463d11f75851aba8a (diff)
downloadgo-e2c420591cbbd684594a111fa5cdeb40c68964a5.tar.gz
go-e2c420591cbbd684594a111fa5cdeb40c68964a5.zip
cmd/go/internal/modload: remove printStackInDie functionality
Previously, when running cmd/go tests, if the module root directory is requested when modules are explicitly disabled, we printed a stack trace in addition to the error message that's normally printed. The stack trace isn't that useful, and it makes the actual error hard to find. Change-Id: I8230d668f3f16659f08d0d685124c41b4055c5b9 Reviewed-on: https://go-review.googlesource.com/c/go/+/263659 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/init.go')
-rw-r--r--src/cmd/go/internal/modload/init.go10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go
index e1b784860b..1fcc53735c 100644
--- a/src/cmd/go/internal/modload/init.go
+++ b/src/cmd/go/internal/modload/init.go
@@ -16,7 +16,6 @@ import (
"os"
"path"
"path/filepath"
- "runtime/debug"
"strconv"
"strings"
@@ -330,16 +329,7 @@ func ModFilePath() string {
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
-// unexpectedly require a main module.
-var printStackInDie = false
-
func die() {
- if printStackInDie {
- debug.PrintStack()
- }
if cfg.Getenv("GO111MODULE") == "off" {
base.Fatalf("go: modules disabled by GO111MODULE=off; see 'go help modules'")
}