Documentation ¶
Overview ¶
Package importpaths implement import path rewriting credit: https://gist.github.com/jackspirou/61ce33574e9f411b8b4a
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSkip = errors.New("skip import")
ErrSkip is used to signal that an import should be skipped
Functions ¶
func Rewrite ¶
func Rewrite(dir string, replace ReplaceFunc) error
Rewrite takes a directory path and a function for replacing imports paths
func RewriteFile ¶
func RewriteFile(name string, replace ReplaceFunc) error
RewriteFile rewrites import statments in the named file according to the rules supplied by the map of strings.
Types ¶
type ReplaceFunc ¶
ReplaceFunc is called with every import path and returns the replacement path if the second return parameter is false, the replacement doesn't happen
Click to show internal directories.
Click to hide internal directories.