Documentation
¶
Overview ¶
Package file provides helpers to locate files based on their import path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
Finder locates source code files.
func New ¶
New returns a new Finder which can be used to locate files from import paths.
It logs locating details on the given logger, if set, at debug level.
func (*Finder) Find ¶
Find returns the absolute path of a file from the given import path.
Import path can be either: - a relative path: `./rel/path/to/file.go` - an absolute path: `/abs/path/to/file.go` - an FQDN-based path: `fqdn/path/to/file.go`
FQDN-based paths are resolved based on the GOROOT and GOPATH environment variables, then relative to the `go.mod` file set on the Finder, if any.