MCPcopy Create free account
hub / github.com/despiteallobjections/amigo / packageLevelValue

Method packageLevelValue

types/source.go:30–35  ·  view source on GitHub ↗

packageLevelValue returns the package-level value corresponding to the specified named object, which may be a package-level const (*Const), var (*Global) or func (*Function) of some package in prog. It returns nil if the object is not found.

(obj Object)

Source from the content-addressed store, hash-verified

28// prog. It returns nil if the object is not found.
29//
30func (prog *Program) packageLevelValue(obj Object) Value {
31 if pkg := prog.Package(obj.Pkg()); pkg != nil {
32 return pkg.values[obj]
33 }
34 return nil
35}
36
37// tokenPos returns n.Pos().
38//

Callers 4

declaredFuncMethod · 0.95
addrMethod · 0.80
expr0Method · 0.80
buildMethod · 0.80

Calls 2

PackageMethod · 0.95
PkgMethod · 0.65

Tested by

no test coverage detected