Documentation ¶
Overview ¶
Package source provides a way to refer to source files. Valid sources include:
/local/path/to/file.go /local/path/to/package github.com/matryer/package github.com/matryer/package/specific-file.go https://domain.com/path/to/file
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultLookup = &Lookup{}
DefaultLookup is a default Lookup instance.
Functions ¶
This section is empty.
Types ¶
type ErrNotFound ¶
type ErrNotFound string
ErrNotFound indicates the source file could not be found.
func (ErrNotFound) Error ¶
func (e ErrNotFound) Error() string
type Lookup ¶
Lookup provides source lookup capabilities.
func (*Lookup) Get ¶
Get gets the file at the given source. Valid sources include local paths, URLs, or go gettable paths. Sources must be closed. Valid sources include:
/local/path/to/file.go /local/path/to/package github.com/matryer/package github.com/matryer/package/specific-file.go https://domain.com/path/to/file
Special strings ¶
The string "default" will be taken to mean the default source file which can be found in default/source.go. A special template prefix will indicate the template is hosted in the official https://github.com/matryer/codeform-templates repository.
template:testing/mocking/mock
type Source ¶
Source represents the source of a code file or package. Sources must always be closed.