types

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MPL-2.0, MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsObjectGlobalRef

func IsObjectGlobalRef(obj std_types.Object) bool

IsObjectGlobalRef returns true if the object refers to a name in the global scope.

For example, a file may declare a global constant "X" and inside a function the constant is assigned to a new local variable. In that assignment, globalRef would be true because when "X" is used inside the function, it refers to the global. However if a local constant "X" had been declared above the assignment, globalRef would be false because it refers to a local-scope name.

We compute this by checking if the object's scope is the same as the package's.

func ParseTypeObject

func ParseTypeObject(t std_types.Object) (pkgPath, typeName string)

ParseTypeObject parses a go/types.Type node for its package/type details.

func ParseTypeString

func ParseTypeString(s string) (typePkgPath, typeName string)

ParseTypeString parses "simple," single-type go/types.Type.String() values in the form "<import path>.<type name>".

Types

This section is empty.

Jump to

Keyboard shortcuts

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