imports

package
v0.0.0-...-34c5bf1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Imp

type Imp struct {
	Alias string
	Path  string
}

Imp represents a go import

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages go imports

func NewManager

func NewManager(self string) *Manager

NewManager returns an import manager for the package described by self. It should be a complete import path.

func (*Manager) Add

func (m *Manager) Add(path string) string

Add adds a new import to the manager and returns the alias to use, if any.

func (*Manager) Get

func (m *Manager) Get() []*Imp

Get returns all of the imports

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver figures out go import paths for packages

func NewResolver

func NewResolver() (*Resolver, error)

NewResolver figures out the go module name and directory and returns an initialised Resolver

func (*Resolver) Resolve

func (r *Resolver) Resolve(defPath, pkg string) (string, error)

Resolve returns the import path for a package in service s. It assumes that the def file exists in the root of service s.

Jump to

Keyboard shortcuts

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