all: Remove unused code

Using x/tools/cmd/deadcode
This commit is contained in:
Bjørn Erik Pedersen 2023-12-18 17:41:15 +01:00
parent 6f13430d4a
commit 8adba648cc
30 changed files with 32 additions and 405 deletions

View file

@ -15,6 +15,7 @@ package modules
import (
"bufio"
"errors"
"fmt"
"os"
"path/filepath"
@ -37,8 +38,6 @@ import (
"github.com/rogpeppe/go-internal/module"
"errors"
"github.com/gohugoio/hugo/config"
"github.com/spf13/afero"
)
@ -47,11 +46,6 @@ var ErrNotExist = errors.New("module does not exist")
const vendorModulesFilename = "modules.txt"
// IsNotExist returns whether an error means that a module could not be found.
func IsNotExist(err error) bool {
return errors.Is(err, os.ErrNotExist)
}
func (h *Client) Collect() (ModulesConfig, error) {
mc, coll := h.collect(true)
if coll.err != nil {
@ -124,7 +118,6 @@ func (m ModulesConfig) HasConfigFile() bool {
if len(mod.ConfigFilenames()) > 0 {
return true
}
}
return false
}
@ -220,7 +213,6 @@ func (c *collector) getVendoredDir(path string) (vendoredModule, bool) {
}
func (c *collector) add(owner *moduleAdapter, moduleImport Import) (*moduleAdapter, error) {
var (
mod *goModule
moduleDir string
@ -669,7 +661,6 @@ func (c *collector) normalizeMounts(owner *moduleAdapter, mounts []Mount) ([]Mou
} else {
continue
}
}
// Verify that target points to one of the predefined component dirs