gocli

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocateGoMod

func LocateGoMod(from string) (importPath, modPath string, err error)

func ModuleInfo

func ModuleInfo(workdir string, modName ...string) (map[string]ModuleInformation, error)

Types

type GoPkgData

type GoPkgData struct {
	ImportPath string `json:"ImportPath"`
	Name       string `json:"Name"`
}

type ImportMap

type ImportMap struct {
	// Which name is provided by a given package?
	// Assocs package->name
	Imports map[string]GoPkgData
}

func NewImportMap

func NewImportMap() *ImportMap

func (*ImportMap) IndexPackages

func (i *ImportMap) IndexPackages(paths ...string) (map[string]GoPkgData, error)

func (*ImportMap) RunPkgList

func (i *ImportMap) RunPkgList(pkgs ...string) ([]GoPkgData, error)

type ModuleInformation

type ModuleInformation struct {
	// Name represents the module as when used to refer to members of the
	// package
	Name string

	// Dir represents the directory containing module files
	Dir string

	// ImportPath represents the path used to import the module
	ImportPath string
}

Jump to

Keyboard shortcuts

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