From bee1ab494bec3ba8710a2a178a05deae21df5a8f Mon Sep 17 00:00:00 2001 From: Aidan Coyle Date: Fri, 11 Jun 2021 14:35:53 +0000 Subject: [PATCH] cmd/present better error message Provide a better suggestion for how to fix the error when static files cannot be loaded due to installing and running in module aware mode. See: https://github.com/golang/go/issues/43459 --- cmd/present/main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/present/main.go b/cmd/present/main.go index b89e11fe55e..f41d5b9e79b 100644 --- a/cmd/present/main.go +++ b/cmd/present/main.go @@ -137,6 +137,15 @@ static content by looking for a %q package in your Go workspaces (GOPATH). You may use the -base flag to specify an alternate location. + +If you installed this binary in module-aware mode (which is default for +go versions 1.16 and above) then you may see the following error: + +Couldn't find gopresent files: no required module provides package golang.org/x/tools/cmd/present + +If so, you may need to specify the module path with the -base flag. + +e.g. -base ~/go/pkg/mod/golang.org/x/tools@v0.1.3/cmd/present ` const localhostWarning = `