inject

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReceiverAnalyzer = &analysis.Analyzer{
	Name:       "checkPointerReceiver",
	Doc:        "check if the inject method is bound to a pointer receiver",
	Run:        runReceiverAnalyzer,
	Requires:   []*analysis.Analyzer{inspect.Analyzer},
	ResultType: reflect.TypeOf(*new([]*ast.FuncDecl)),
}

ReceiverAnalyzer checks if an inject-function is bound to a pointer-receiver

View Source
var TagAnalyzer = &analysis.Analyzer{
	Name:     "checkProperInjectTags",
	Doc:      "check if convention of using inject tags is respected",
	Run:      runTagAnalyzer,
	Requires: []*analysis.Analyzer{inspect.Analyzer, ReceiverAnalyzer},
}

TagAnalyzer checks if the inject tags are used properly. inject tags should be used for config injection only, otherwise an inject method should be used. This means: - No empty inject tags - Inject tags can be defined in the Inject-Function or must be referenced if defined outside - They must be declared in the same package as the Inject-Function

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL