Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsStandard ¶
IsStandard returns whether a package is in the standard library.
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves import strings in source files (import paths in Go, import statements in protos) into Bazel labels.
func NewResolver ¶
func (*Resolver) ResolveRule ¶
ResolveRule copies and modifies a generated rule e by replacing the import paths in the "_gazelle_imports" attribute with labels in a "deps" attribute. This may be safely called on expressions that aren't Go rules (the original expression will be returned). Any existing "deps" attribute is deleted, so it may be necessary to merge the result.
type RuleIndex ¶
type RuleIndex struct {
// contains filtered or unexported fields
}
RuleIndex is a table of rules in a workspace, indexed by label and by import path. Used by Resolver to map import paths to labels.
func NewRuleIndex ¶
func NewRuleIndex() *RuleIndex
func (*RuleIndex) AddRulesFromFile ¶
AddRulesFromFile adds existing rules to the index from file (which must not be nil).
func (*RuleIndex) Finish ¶
func (ix *RuleIndex) Finish()
Finish constructs the import index and performs any other necessary indexing actions after all rules have been added. This step is necessary because a rule may be indexed differently based on what rules are added later.
This function must be called after all AddRulesFromFile calls but before any findRuleByImport calls.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
gen_std_package_list reads a text file containing a list of packages (one per line) and generates a .go file containing a set of package names.
|
gen_std_package_list reads a text file containing a list of packages (one per line) and generates a .go file containing a set of package names. |