From 43298f028ccdf38e949b573d03d328bf96b998a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 3 Sep 2019 12:58:02 +0200 Subject: Make the "is this a Hugo Module" logic more lenient Now we only try to load modules via Go if there is one or more modules imported in project config. Fixes #6299 --- modules/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/client.go') diff --git a/modules/client.go b/modules/client.go index ae1a6a2b2..a743df5bd 100644 --- a/modules/client.go +++ b/modules/client.go @@ -279,12 +279,12 @@ func (c *Client) Init(path string) error { return nil } -func (c *Client) isProbablyModule(path string) bool { +func isProbablyModule(path string) bool { return module.CheckPath(path) == nil } func (c *Client) listGoMods() (goModules, error) { - if c.GoModulesFilename == "" { + if c.GoModulesFilename == "" || !c.moduleConfig.hasModuleImport() { return nil, nil } -- cgit v1.2.3